Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding step functions endpoints #8118

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ type Config struct {
S3Endpoint string
S3ControlEndpoint string
SesEndpoint string
SfnEndpoint string
SnsEndpoint string
SqsEndpoint string
StsEndpoint string
Expand Down Expand Up @@ -457,7 +458,7 @@ func (c *Config) Client() (interface{}, error) {
securityhubconn: securityhub.New(sess),
serverlessapplicationrepositoryconn: serverlessapplicationrepository.New(sess),
sesConn: ses.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.SesEndpoint)})),
sfnconn: sfn.New(sess),
sfnconn: sfn.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.SfnEndpoint)})),
shieldconn: shield.New(sess),
simpledbconn: simpledb.New(sess),
snsconn: sns.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.SnsEndpoint)})),
Expand Down
10 changes: 10 additions & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,8 @@ func init() {

"ses_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",

"sfn_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",

"sns_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",

"sqs_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",
Expand Down Expand Up @@ -968,6 +970,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.S3Endpoint = endpoints["s3"].(string)
config.S3ControlEndpoint = endpoints["s3control"].(string)
config.SesEndpoint = endpoints["ses"].(string)
config.SfnEndpoint = endpoints["sfn"].(string)
config.SnsEndpoint = endpoints["sns"].(string)
config.SqsEndpoint = endpoints["sqs"].(string)
config.StsEndpoint = endpoints["sts"].(string)
Expand Down Expand Up @@ -1201,6 +1204,12 @@ func endpointsSchema() *schema.Schema {
Default: "",
Description: descriptions["ses_endpoint"],
},
"sfn": {
Type: schema.TypeString,
Optional: true,
Default: "",
Description: descriptions["sfn_endpoint"],
},
"sns": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -1254,6 +1263,7 @@ func endpointsToHash(v interface{}) int {
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["sfn"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["sns"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["sqs"].(string)))

Expand Down
4 changes: 4 additions & 0 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ Nested `endpoints` block supports the following:
URL constructed from the `region`. It's typically used to connect to
custom SNS endpoints.

* `sfn` - (Optional) Use this to override the default endpoint
URL constructed from the `region`. It's typically used to connect to
custom SFN endpoints.

* `sns` - (Optional) Use this to override the default endpoint
URL constructed from the `region`. It's typically used to connect to
custom SNS endpoints.
Expand Down