Skip to content

Commit

Permalink
Flourish of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Nov 14, 2024
1 parent 402dfad commit 39316d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion internal/service/apigateway/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func resourceIntegrationUpdate(ctx context.Context, d *schema.ResourceData, meta
// the #29991 attempt in *method* but it can likely be removed.

// No reasonable way to determine the first stage has fully propagated, so we wait a bit.
time.Sleep(3 * time.Second)
time.Sleep(pauseBetweenUpdateStages)

integration, err := findIntegrationByThreePartKey(ctx, conn, d.Get("http_method").(string), d.Get(names.AttrResourceID).(string), d.Get("rest_api_id").(string))
if err != nil {
Expand Down Expand Up @@ -617,6 +617,8 @@ const (
requestParameterType = "requestParameters"
cacheKeyParameterType = "cacheKeyParameters"
requestTemplatesType = "requestTemplates"

pauseBetweenUpdateStages = 3 * time.Second
)

// parameterizeParameter takes a parameter path and adds a prefix and escapes. For example:
Expand Down
14 changes: 7 additions & 7 deletions internal/service/apigateway/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1081,11 +1081,11 @@ resource "aws_api_gateway_method" "test" {
"application/json" = "Error"
}
request_parameters = {for param in var.utm_params : "method.request.querystring.${param}" => false}
request_parameters = { for param in var.utm_params : "method.request.querystring.${param}" => false }
}
variable "utm_params" {
type = list(string)
type = list(string)
default = ["%[2]s"]
}
Expand All @@ -1098,7 +1098,7 @@ resource "aws_api_gateway_integration" "test" {
type = "HTTP_PROXY"
uri = "https://www.google.de"
request_parameters = {for param in var.utm_params : "integration.request.querystring.${param}" => "method.request.querystring.${param}"}
request_parameters = { for param in var.utm_params : "integration.request.querystring.${param}" => "method.request.querystring.${param}" }
}
`, rName, strings.Join(params, `", "`))
}
Expand All @@ -1116,7 +1116,7 @@ resource "aws_api_gateway_resource" "test" {
}
variable "utm_params" {
type = list(string)
type = list(string)
default = ["%[2]s"]
}
Expand All @@ -1130,7 +1130,7 @@ resource "aws_api_gateway_method" "test" {
{
"method.request.path.proxy" = true
},
{for param in var.utm_params : "method.request.querystring.${param}" => false}
{ for param in var.utm_params : "method.request.querystring.${param}" => false }
)
}
Expand All @@ -1146,8 +1146,8 @@ resource "aws_api_gateway_integration" "test" {
request_parameters = merge({
"integration.request.path.proxy" = "method.request.path.proxy"
"integration.request.header.Host" = "'method.request.querystring.name'"
},
{for param in var.utm_params : "integration.request.querystring.${param}" => "method.request.querystring.${param}"}
},
{ for param in var.utm_params : "integration.request.querystring.${param}" => "method.request.querystring.${param}" }
)
cache_key_parameters = concat(
Expand Down

0 comments on commit 39316d8

Please sign in to comment.