-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
B inconsistent field #40707
B inconsistent field #40707
Conversation
Modified the reimportOpenAPIDefinition to make consistent the name in input. The original behavior was altered by the resourceAPIRead that would cause to change the name (and the version) of the ApiGateway at the creation state.
Added test for the issue hashicorp#40505 to verify if the name is the same as in input of the resource configuration and not a default name
Community NoteVoting for Prioritization
For Submitters
|
…ription', 'name' or 'version' if they are not present in the OpenAPI definition.
Thank you for your contribution! 🚀 Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the Additional details:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccAPIGatewayV2API_' PKG=apigatewayv2 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/apigatewayv2/... -v -count 1 -parallel 3 -run=TestAccAPIGatewayV2API_ -timeout 360m
2024/12/29 17:28:51 Initializing Terraform AWS Provider...
=== RUN TestAccAPIGatewayV2API_tags
=== PAUSE TestAccAPIGatewayV2API_tags
=== RUN TestAccAPIGatewayV2API_tags_null
=== PAUSE TestAccAPIGatewayV2API_tags_null
=== RUN TestAccAPIGatewayV2API_tags_EmptyMap
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyMap
=== RUN TestAccAPIGatewayV2API_tags_AddOnUpdate
=== PAUSE TestAccAPIGatewayV2API_tags_AddOnUpdate
=== RUN TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate
=== RUN TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add
=== RUN TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_overlapping
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_overlapping
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag
=== RUN TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag
=== RUN TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate
=== PAUSE TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate
=== RUN TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add
=== RUN TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace
=== RUN TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag
=== PAUSE TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag
=== RUN TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag
=== PAUSE TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag
=== RUN TestAccAPIGatewayV2API_basicWebSocket
=== PAUSE TestAccAPIGatewayV2API_basicWebSocket
=== RUN TestAccAPIGatewayV2API_basicHTTP
=== PAUSE TestAccAPIGatewayV2API_basicHTTP
=== RUN TestAccAPIGatewayV2API_disappears
=== PAUSE TestAccAPIGatewayV2API_disappears
=== RUN TestAccAPIGatewayV2API_allAttributesWebSocket
=== PAUSE TestAccAPIGatewayV2API_allAttributesWebSocket
=== RUN TestAccAPIGatewayV2API_allAttributesHTTP
=== PAUSE TestAccAPIGatewayV2API_allAttributesHTTP
=== RUN TestAccAPIGatewayV2API_openAPI
=== PAUSE TestAccAPIGatewayV2API_openAPI
=== RUN TestAccAPIGatewayV2API_OpenAPI_withTags
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_withTags
=== RUN TestAccAPIGatewayV2API_OpenAPI_withCors
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_withCors
=== RUN TestAccAPIGatewayV2API_OpenAPI_withMoreFields
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_withMoreFields
=== RUN TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
=== RUN TestAccAPIGatewayV2API_cors
=== PAUSE TestAccAPIGatewayV2API_cors
=== RUN TestAccAPIGatewayV2API_quickCreate
=== PAUSE TestAccAPIGatewayV2API_quickCreate
=== RUN TestAccAPIGatewayV2API_OpenAPI_noTitle
=== PAUSE TestAccAPIGatewayV2API_OpenAPI_noTitle
=== CONT TestAccAPIGatewayV2API_tags
=== CONT TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add
=== CONT TestAccAPIGatewayV2API_openAPI
--- PASS: TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Add (27.73s)
=== CONT TestAccAPIGatewayV2API_OpenAPI_noTitle
--- PASS: TestAccAPIGatewayV2API_openAPI (28.34s)
=== CONT TestAccAPIGatewayV2API_quickCreate
--- PASS: TestAccAPIGatewayV2API_OpenAPI_noTitle (14.93s)
=== CONT TestAccAPIGatewayV2API_cors
--- PASS: TestAccAPIGatewayV2API_quickCreate (14.17s)
=== CONT TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
--- PASS: TestAccAPIGatewayV2API_tags (47.81s)
=== CONT TestAccAPIGatewayV2API_OpenAPI_withMoreFields
=== NAME TestAccAPIGatewayV2API_OpenAPI_failOnWarnings
api_test.go:509: Step 1/5, expected an error with pattern, no match on: After applying this test step, the non-refresh plan was not empty.
stdout:
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_apigatewayv2_api.test will be updated in-place
~ resource "aws_apigatewayv2_api" "test" {
- description = "Description test" -> null
id = "oe1umios86"
~ name = "Title test" -> "tf-acc-test-5492610049081969265"
- version = "2.0" -> null
# (10 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAPIGatewayV2API_OpenAPI_failOnWarnings (11.16s)
=== CONT TestAccAPIGatewayV2API_OpenAPI_withCors
--- PASS: TestAccAPIGatewayV2API_cors (28.12s)
=== CONT TestAccAPIGatewayV2API_OpenAPI_withTags
--- PASS: TestAccAPIGatewayV2API_OpenAPI_withMoreFields (28.81s)
=== CONT TestAccAPIGatewayV2API_basicHTTP
--- PASS: TestAccAPIGatewayV2API_OpenAPI_withCors (34.65s)
=== CONT TestAccAPIGatewayV2API_allAttributesHTTP
--- PASS: TestAccAPIGatewayV2API_basicHTTP (13.25s)
=== CONT TestAccAPIGatewayV2API_allAttributesWebSocket
--- PASS: TestAccAPIGatewayV2API_OpenAPI_withTags (27.38s)
=== CONT TestAccAPIGatewayV2API_disappears
--- PASS: TestAccAPIGatewayV2API_disappears (11.40s)
=== CONT TestAccAPIGatewayV2API_basicWebSocket
--- PASS: TestAccAPIGatewayV2API_basicWebSocket (13.01s)
=== CONT TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccAPIGatewayV2API_allAttributesHTTP (35.40s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_overlapping
--- PASS: TestAccAPIGatewayV2API_allAttributesWebSocket (36.34s)
=== CONT TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate
--- PASS: TestAccAPIGatewayV2API_tags_ComputedTag_OnCreate (17.61s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_DefaultTag (28.20s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_nullNonOverlappingResourceTag (14.33s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_overlapping (37.15s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_nullOverlappingResourceTag (14.46s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_emptyProviderOnlyTag (15.05s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_emptyResourceTag (15.14s)
=== CONT TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_updateToResourceOnly (21.95s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_updateToProviderOnly (22.72s)
=== CONT TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly
--- PASS: TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Add (33.57s)
=== CONT TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_nonOverlapping (36.50s)
=== CONT TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccAPIGatewayV2API_tags_IgnoreTags_Overlap_ResourceTag (32.98s)
=== CONT TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccAPIGatewayV2API_tags_DefaultTags_providerOnly (47.80s)
=== CONT TestAccAPIGatewayV2API_tags_AddOnUpdate
--- PASS: TestAccAPIGatewayV2API_tags_EmptyTag_OnUpdate_Replace (22.88s)
=== CONT TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate
--- PASS: TestAccAPIGatewayV2API_tags_AddOnUpdate (22.40s)
=== CONT TestAccAPIGatewayV2API_tags_EmptyMap
--- PASS: TestAccAPIGatewayV2API_tags_ComputedTag_OnUpdate_Replace (26.43s)
=== CONT TestAccAPIGatewayV2API_tags_null
--- PASS: TestAccAPIGatewayV2API_tags_EmptyTag_OnCreate (25.24s)
--- PASS: TestAccAPIGatewayV2API_tags_EmptyMap (17.19s)
--- PASS: TestAccAPIGatewayV2API_tags_null (17.72s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2 292.212s
FAIL
make: *** [testacc] Error 1
Failure is unrelated to this change and is occurring in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
@Klopklopi Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.83.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Description
Modified the reimportOpenAPIDefinition to make consistent the name in input. The original behavior was altered by the resourceAPIRead that would cause to change the name (and the version) of the ApiGateway at the creation state.
Added test to verify if the name is the same as in input of the resource configuration and not a default name
Relations
Closes #40505.
Closes #33389.
References
Output from Acceptance Testing