diff --git a/aws/config.go b/aws/config.go index ddd37e24c7a..51c430b796b 100644 --- a/aws/config.go +++ b/aws/config.go @@ -124,6 +124,7 @@ type Config struct { Ec2Endpoint string EcsEndpoint string EcrEndpoint string + EfsEndpoint string EsEndpoint string ElbEndpoint string IamEndpoint string @@ -389,6 +390,7 @@ func (c *Config) Client() (interface{}, error) { awsEc2Sess := sess.Copy(&aws.Config{Endpoint: aws.String(c.Ec2Endpoint)}) awsEcrSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.EcrEndpoint)}) awsEcsSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.EcsEndpoint)}) + awsEfsSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.EfsEndpoint)}) awsElbSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.ElbEndpoint)}) awsEsSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.EsEndpoint)}) awsIamSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.IamEndpoint)}) @@ -473,7 +475,7 @@ func (c *Config) Client() (interface{}, error) { client.dynamodbconn = dynamodb.New(awsDynamoSess) client.ecrconn = ecr.New(awsEcrSess) client.ecsconn = ecs.New(awsEcsSess) - client.efsconn = efs.New(sess) + client.efsconn = efs.New(awsEfsSess) client.elasticacheconn = elasticache.New(sess) client.elasticbeanstalkconn = elasticbeanstalk.New(sess) client.elastictranscoderconn = elastictranscoder.New(sess) diff --git a/aws/provider.go b/aws/provider.go index 876cffce67a..681a3426128 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -688,6 +688,8 @@ func init() { "ec2_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", + "efs_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", + "elb_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", "es_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", @@ -795,6 +797,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { config.Ec2Endpoint = endpoints["ec2"].(string) config.EcrEndpoint = endpoints["ecr"].(string) config.EcsEndpoint = endpoints["ecs"].(string) + config.EfsEndpoint = endpoints["efs"].(string) config.ElbEndpoint = endpoints["elb"].(string) config.EsEndpoint = endpoints["es"].(string) config.IamEndpoint = endpoints["iam"].(string) @@ -941,6 +944,13 @@ func endpointsSchema() *schema.Schema { Description: descriptions["ecs_endpoint"], }, + "efs": { + Type: schema.TypeString, + Optional: true, + Default: "", + Description: descriptions["efs_endpoint"], + }, + "elb": { Type: schema.TypeString, Optional: true, @@ -1031,6 +1041,7 @@ func endpointsToHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["dynamodb"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["iam"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["ec2"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["efs"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["elb"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["kinesis"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["kms"].(string))) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 36dd561a98d..0eb63049ebf 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -299,6 +299,10 @@ Nested `endpoints` block supports the following: URL constructed from the `region`. It's typically used to connect to custom ELB endpoints. +* `efs` - (Optional) Use this to override the default endpoint + URL constructed from the `region`. It's typically used to connect to + custom EFS endpoints. + * `es` - (Optional) Use this to override the default endpoint URL constructed from the `region`. It's typically used to connect to custom Elasticsearch endpoints.