Skip to content

Commit

Permalink
Add redshift endpoint override.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Helbling committed Mar 19, 2019
1 parent 3725d86 commit 1fa397a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ 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
Expand Down Expand Up @@ -406,7 +406,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.Copy(&aws.Config{Endpoint: aws.String(c.FirehoseEndpoint)})),
firehoseconn: firehose.New(sess),
fmsconn: fms.New(sess),
fsxconn: fsx.New(sess),
gameliftconn: gamelift.New(sess),
Expand Down Expand Up @@ -443,7 +443,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),
Expand Down
20 changes: 10 additions & 10 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,6 @@ 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.",

Expand All @@ -838,6 +836,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",
Expand Down Expand Up @@ -941,7 +941,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.DeviceFarmEndpoint = endpoints["devicefarm"].(string)
config.DynamoDBEndpoint = endpoints["dynamodb"].(string)
config.Ec2Endpoint = endpoints["ec2"].(string)
config.FirehoseEndpoint = endpoints["firehose"].(string)
config.AutoscalingEndpoint = endpoints["autoscaling"].(string)
config.EcrEndpoint = endpoints["ecr"].(string)
config.EcsEndpoint = endpoints["ecs"].(string)
Expand All @@ -955,6 +954,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)
Expand Down Expand Up @@ -1125,12 +1125,6 @@ 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,
Expand Down Expand Up @@ -1167,6 +1161,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,
Expand Down Expand Up @@ -1225,7 +1225,6 @@ func endpointsToHash(v interface{}) int {
buf.WriteString(fmt.Sprintf("%s-", m["cloudformation"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["devicefarm"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["dynamodb"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["firehose"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["iam"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["ec2"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["autoscaling"].(string)))
Expand All @@ -1235,6 +1234,7 @@ func endpointsToHash(v interface{}) int {
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)))
Expand Down
10 changes: 5 additions & 5 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ 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.
Expand All @@ -367,11 +363,15 @@ Nested `endpoints` block supports the following:
* `r53` - (Optional) Use this to override the default endpoint
URL constructed from the `region`. It's typically used to connect to
custom Route53 endpoints.

* `rds` - (Optional) Use this to override the default endpoint
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.
Expand Down

0 comments on commit 1fa397a

Please sign in to comment.