provider/aws: rename usEast1Sess to r53Sess and document

This commit is contained in:
Jake Champlin 2017-05-19 17:03:34 -04:00
parent 0abfda4d8b
commit 85895cecc7
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
1 changed files with 6 additions and 7 deletions

View File

@ -269,12 +269,11 @@ func (c *Config) Client() (interface{}, error) {
sess.Handlers.UnmarshalError.PushFrontNamed(debugAuthFailure) sess.Handlers.UnmarshalError.PushFrontNamed(debugAuthFailure)
} }
// Some services exist only in us-east-1, e.g. because they manage // This restriction should only be used for Route53 sessions.
// resources that can span across multiple regions, or because // Other resources that have restrictions should allow the API to fail, rather
// signature format v4 requires region to be us-east-1 for global // than Terraform abstracting the region for the user. This can lead to breaking
// endpoints: // changes if that resource is ever opened up to more regions.
// http://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html r53Sess := sess.Copy(&aws.Config{Region: aws.String("us-east-1")})
usEast1Sess := sess.Copy(&aws.Config{Region: aws.String("us-east-1")})
// Some services have user-configurable endpoints // Some services have user-configurable endpoints
awsCfSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.CloudFormationEndpoint)}) awsCfSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.CloudFormationEndpoint)})
@ -370,7 +369,7 @@ func (c *Config) Client() (interface{}, error) {
client.lambdaconn = lambda.New(sess) client.lambdaconn = lambda.New(sess)
client.lightsailconn = lightsail.New(sess) client.lightsailconn = lightsail.New(sess)
client.opsworksconn = opsworks.New(sess) client.opsworksconn = opsworks.New(sess)
client.r53conn = route53.New(usEast1Sess) client.r53conn = route53.New(r53Sess)
client.rdsconn = rds.New(awsRdsSess) client.rdsconn = rds.New(awsRdsSess)
client.redshiftconn = redshift.New(sess) client.redshiftconn = redshift.New(sess)
client.simpledbconn = simpledb.New(sess) client.simpledbconn = simpledb.New(sess)