diff --git a/aws/config.go b/aws/config.go index fe3404d5375..eadcdf84083 100644 --- a/aws/config.go +++ b/aws/config.go @@ -158,12 +158,14 @@ type Config struct { EfsEndpoint string EsEndpoint string ElbEndpoint string + FirehoseEndpoint string IamEndpoint string KinesisEndpoint string KinesisAnalyticsEndpoint string KmsEndpoint string LambdaEndpoint string RdsEndpoint string + RedshiftEndpoint string R53Endpoint string S3Endpoint string S3ControlEndpoint string @@ -405,7 +407,7 @@ func (c *Config) Client() (interface{}, error) { elbv2conn: elbv2.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.ElbEndpoint)})), emrconn: emr.New(sess), esconn: elasticsearch.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.EsEndpoint)})), - firehoseconn: firehose.New(sess), + firehoseconn: firehose.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.FirehoseEndpoint)})), fmsconn: fms.New(sess), fsxconn: fsx.New(sess), gameliftconn: gamelift.New(sess), @@ -442,7 +444,7 @@ func (c *Config) Client() (interface{}, error) { r53conn: route53.New(sess.Copy(&aws.Config{Region: aws.String("us-east-1"), Endpoint: aws.String(c.R53Endpoint)})), ramconn: ram.New(sess), rdsconn: rds.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.RdsEndpoint)})), - redshiftconn: redshift.New(sess), + redshiftconn: redshift.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.RedshiftEndpoint)})), region: c.Region, resourcegroupsconn: resourcegroups.New(sess), route53resolverconn: route53resolver.New(sess), diff --git a/aws/provider.go b/aws/provider.go index b9790f743f6..9ddaa496ef1 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -813,6 +813,8 @@ func init() { "dynamodb_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n" + "It's typically used to connect to dynamodb-local.", + "firehose_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", + "kinesis_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n" + "It's typically used to connect to kinesalite.", @@ -836,6 +838,8 @@ func init() { "rds_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", + "redshift_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", + "s3_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", "s3control_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n", @@ -945,6 +949,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { config.EfsEndpoint = endpoints["efs"].(string) config.ElbEndpoint = endpoints["elb"].(string) config.EsEndpoint = endpoints["es"].(string) + config.FirehoseEndpoint = endpoints["firehose"].(string) config.IamEndpoint = endpoints["iam"].(string) config.KinesisEndpoint = endpoints["kinesis"].(string) config.KinesisAnalyticsEndpoint = endpoints["kinesis_analytics"].(string) @@ -952,6 +957,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { config.LambdaEndpoint = endpoints["lambda"].(string) config.R53Endpoint = endpoints["r53"].(string) config.RdsEndpoint = endpoints["rds"].(string) + config.RedshiftEndpoint = endpoints["redshift"].(string) config.S3Endpoint = endpoints["s3"].(string) config.S3ControlEndpoint = endpoints["s3control"].(string) config.SesEndpoint = endpoints["ses"].(string) @@ -1122,6 +1128,12 @@ func endpointsSchema() *schema.Schema { Default: "", Description: descriptions["es_endpoint"], }, + "firehose": { + Type: schema.TypeString, + Optional: true, + Default: "", + Description: descriptions["firehose_endpoint"], + }, "kinesis": { Type: schema.TypeString, Optional: true, @@ -1158,6 +1170,12 @@ func endpointsSchema() *schema.Schema { Default: "", Description: descriptions["rds_endpoint"], }, + "redshift": { + Type: schema.TypeString, + Optional: true, + Default: "", + Description: descriptions["redshift_endpoint"], + }, "s3": { Type: schema.TypeString, Optional: true, @@ -1221,10 +1239,12 @@ func endpointsToHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["autoscaling"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["efs"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["elb"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["firehose"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["kinesis"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["kms"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["lambda"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["rds"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["redshift"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["s3"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["ses"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["sns"].(string))) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index c8717ecfdc5..0369b9ed4f8 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -344,6 +344,10 @@ Nested `endpoints` block supports the following: URL constructed from the `region`. It's typically used to connect to custom Elasticsearch endpoints. +* `firehose` - (Optional) Use this to override the default endpoint + URL constructed from the `region`. It's typically used to connect to + custom Firehose endpoints. + * `iam` - (Optional) Use this to override the default endpoint URL constructed from the `region`. It's typically used to connect to custom IAM endpoints. @@ -368,6 +372,10 @@ Nested `endpoints` block supports the following: URL constructed from the `region`. It's typically used to connect to custom RDS endpoints. +* `redshift` - (Optional) Use this to override the default endpoint + URL constructed from the `region`. It's typically used to connect to + custom Redshift endpoints. + * `s3` - (Optional) Use this to override the default endpoint URL constructed from the `region`. It's typically used to connect to custom S3 endpoints.