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

[Bug]: Empty aws_apigatewayv2_stage.default_route_settings.throttling_burst_limit results in 0, not "not configured" #27674

Open
krzysztofdrys opened this issue Nov 7, 2022 · 2 comments
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.

Comments

@krzysztofdrys
Copy link

Terraform Core Version

1.3.4,1.2.7

AWS Provider Version

v4.36.1

Affected Resource(s)

aws_apigatewayv2_stage.default_route_settings.throttling_burst_limit

Expected Behavior

When I don't set any value to aws_apigatewayv2_stage.default_route_settings.throttling_burst_limit, I expect to get "Not configured" in AWS as well.

image

Actual Behavior

In AWS I can see "Burst limit" set to 0 (which effectively disable this API Gateway). Moreover, this setting is not reflected in the displayed plan.

image

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_apigatewayv2_api" "this" {
  name          = "${var.origin}"
  protocol_type = "HTTP"

  fail_on_warnings = true
}

resource "aws_apigatewayv2_stage" "stage" {
  api_id      = aws_apigatewayv2_api.this.id
  name        = "master"
  auto_deploy = true

  default_route_settings {
    detailed_metrics_enabled = true
  }
}

I omitted s3 remote state, because I don't this it is relevant.

Steps to Reproduce

terraform init \
  -backend=true \
  -input=false \
  -backend-config="region=${AWS_DEFAULT_REGION}" \
  -backend-config="bucket=${S3_BUCKET}" \
  -backend-config="key=${S3_PATH}"


terraform apply \
  -input=false \
  -var-file=$VAR_FILE.tfvars \
  -var origin="${ORIGIN}"

Debug Output

2022-11-07T10:07:30.136+0100 [INFO]  Terraform version: 1.3.4
2022-11-07T10:07:30.136+0100 [INFO]  Go runtime version: go1.19.3
2022-11-07T10:07:30.136+0100 [INFO]  CLI args: []string{"/usr/local/Cellar/tfenv/3.0.0/versions/1.3.4/terraform", "apply", "-input=false", "-var-file=dev.tfvars", "-var", "pr_number=882", "-var", "package_version=", "-var", "name=882-cps", "-var", "origin=origin-882-cps.dev.newsapis.co.uk"}
2022-11-07T10:07:30.137+0100 [INFO]  CLI command args: []string{"apply", "-input=false", "-var-file=dev.tfvars", "-var", "pr_number=882", "-var", "package_version=", "-var", "name=882-cps", "-var", "origin=origin-882-cps.dev.newsapis.co.uk"}
2022-11-07T10:07:30.141+0100 [INFO]  AWS Auth provider used: "SharedCredentialsProvider"
2022-11-07T10:07:31.321+0100 [INFO]  backend/local: starting Apply operation
2022-11-07T10:07:32.221+0100 [INFO]  provider: configuring client automatic mTLS
2022-11-07T10:07:32.405+0100 [INFO]  provider.terraform-provider-aws_v4.36.1_x5: configuring server automatic mTLS: timestamp=2022-11-07T10:07:32.405+0100
2022-11-07T10:07:32.614+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]
2022-11-07T10:07:32.616+0100 [INFO]  provider: configuring client automatic mTLS
2022-11-07T10:07:32.785+0100 [INFO]  provider.terraform-provider-aws_v4.36.1_x5: configuring server automatic mTLS: timestamp=2022-11-07T10:07:32.784+0100
2022-11-07T10:07:32.962+0100 [INFO]  backend/local: apply calling Plan
2022-11-07T10:07:32.963+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]
2022-11-07T10:07:32.964+0100 [INFO]  provider: configuring client automatic mTLS
2022-11-07T10:07:33.132+0100 [INFO]  provider.terraform-provider-aws_v4.36.1_x5: configuring server automatic mTLS: timestamp=2022-11-07T10:07:33.132+0100
2022-11-07T10:07:33.163+0100 [INFO]  ReferenceTransformer: reference not found: "var.environment"
2022-11-07T10:07:33.165+0100 [INFO]  AWS Auth provider used: "SharedCredentialsProvider"
2022-11-07T10:07:33.292+0100 [INFO]  provider.terraform-provider-aws_v4.36.1_x5: [INFO] Retrieved credentials from "SharedConfigCredentials: /Users/krzysztofdrys/.aws/credentials"
2022-11-07T10:07:33.796+0100 [INFO]  ReferenceTransformer: reference not found: "var.origin"
2022-11-07T10:07:33.800+0100 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_apigatewayv2_api.this, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .route_selection_expression: planned value cty.StringVal("$request.method $request.path") for a non-computed attribute
      - .api_key_selection_expression: planned value cty.StringVal("$request.header.x-api-key") for a non-computed attribute
2022-11-07T10:07:33.803+0100 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_apigatewayv2_stage.stage, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .default_route_settings[0].data_trace_enabled: planned value cty.False for a non-computed attribute
2022-11-07T10:07:34.083+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]
2022-11-07T10:07:37.034+0100 [INFO]  backend/local: apply calling Apply
2022-11-07T10:07:37.035+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]
2022-11-07T10:07:37.036+0100 [INFO]  provider: configuring client automatic mTLS
2022-11-07T10:07:37.210+0100 [INFO]  provider.terraform-provider-aws_v4.36.1_x5: configuring server automatic mTLS: timestamp=2022-11-07T10:07:37.210+0100
2022-11-07T10:07:37.371+0100 [INFO]  provider.terraform-provider-aws_v4.36.1_x5: [INFO] Retrieved credentials from "SharedConfigCredentials: /Users/krzysztofdrys/.aws/credentials"
2022-11-07T10:07:37.882+0100 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_apigatewayv2_api.this, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .route_selection_expression: planned value cty.StringVal("$request.method $request.path") for a non-computed attribute
      - .api_key_selection_expression: planned value cty.StringVal("$request.header.x-api-key") for a non-computed attribute
2022-11-07T10:07:37.882+0100 [INFO]  Starting apply for aws_apigatewayv2_api.this
2022-11-07T10:07:38.610+0100 [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value for aws_apigatewayv2_api.this, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .description: was null, but now cty.StringVal("")
      - .version: was null, but now cty.StringVal("")
      - .disable_execute_api_endpoint: was null, but now cty.False
2022-11-07T10:07:38.615+0100 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_apigatewayv2_stage.stage, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .default_route_settings[0].data_trace_enabled: planned value cty.False for a non-computed attribute
2022-11-07T10:07:38.615+0100 [INFO]  Starting apply for aws_apigatewayv2_stage.stage
2022-11-07T10:07:39.254+0100 [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value for aws_apigatewayv2_stage.stage, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .description: was null, but now cty.StringVal("")
      - .client_certificate_id: was null, but now cty.StringVal("")
      - .default_route_settings[0].throttling_burst_limit: was null, but now cty.NumberIntVal(0)
      - .default_route_settings[0].throttling_rate_limit: was null, but now cty.NumberIntVal(0)

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

@krzysztofdrys krzysztofdrys added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Nov 7, 2022
@krzysztofdrys
Copy link
Author

I assume that the problem is here: aws.Int64Value is used instead of aws.Int64 which would respect null. But I don't know that much about provider/terraform internals, so I think I will for some guidance before proposing a fix. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
Development

No branches or pull requests

2 participants