-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
provider: add additional if-condition when setting tags_all
to new computed
#19251
provider: add additional if-condition when setting tags_all
to new computed
#19251
Conversation
tags_all
to new computed
11ed876
to
919fc83
Compare
24a4577
to
bd40159
Compare
bd40159
to
7d7dce3
Compare
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 🚀.
Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSVpc_' ACCTEST_PARALLELISM=10
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 10 -run=TestAccAWSVpc_ -timeout 180m
=== RUN TestAccAWSVpc_coreMismatchedDiffs
=== PAUSE TestAccAWSVpc_coreMismatchedDiffs
=== RUN TestAccAWSVpc_basic
=== PAUSE TestAccAWSVpc_basic
=== RUN TestAccAWSVpc_disappears
=== PAUSE TestAccAWSVpc_disappears
=== RUN TestAccAWSVpc_defaultTags_providerOnly
=== PAUSE TestAccAWSVpc_defaultTags_providerOnly
=== RUN TestAccAWSVpc_defaultTags_updateToProviderOnly
=== PAUSE TestAccAWSVpc_defaultTags_updateToProviderOnly
=== RUN TestAccAWSVpc_defaultTags_updateToResourceOnly
=== PAUSE TestAccAWSVpc_defaultTags_updateToResourceOnly
=== RUN TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag
=== PAUSE TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag
=== RUN TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag
=== PAUSE TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag
=== RUN TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag
=== PAUSE TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag
=== RUN TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges
=== PAUSE TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges
=== RUN TestAccAWSVpc_DynamicResourceTags_IgnoreChanges
=== PAUSE TestAccAWSVpc_DynamicResourceTags_IgnoreChanges
=== RUN TestAccAWSVpc_defaultAndIgnoreTags
=== PAUSE TestAccAWSVpc_defaultAndIgnoreTags
=== RUN TestAccAWSVpc_ignoreTags
=== PAUSE TestAccAWSVpc_ignoreTags
=== RUN TestAccAWSVpc_AssignGeneratedIpv6CidrBlock
=== PAUSE TestAccAWSVpc_AssignGeneratedIpv6CidrBlock
=== RUN TestAccAWSVpc_Tenancy
=== PAUSE TestAccAWSVpc_Tenancy
=== RUN TestAccAWSVpc_tags
=== PAUSE TestAccAWSVpc_tags
=== RUN TestAccAWSVpc_update
=== PAUSE TestAccAWSVpc_update
=== RUN TestAccAWSVpc_bothDnsOptionsSet
=== PAUSE TestAccAWSVpc_bothDnsOptionsSet
=== RUN TestAccAWSVpc_DisabledDnsSupport
=== PAUSE TestAccAWSVpc_DisabledDnsSupport
=== RUN TestAccAWSVpc_classiclinkOptionSet
=== PAUSE TestAccAWSVpc_classiclinkOptionSet
=== RUN TestAccAWSVpc_classiclinkDnsSupportOptionSet
=== PAUSE TestAccAWSVpc_classiclinkDnsSupportOptionSet
=== CONT TestAccAWSVpc_coreMismatchedDiffs
=== CONT TestAccAWSVpc_defaultAndIgnoreTags
=== CONT TestAccAWSVpc_AssignGeneratedIpv6CidrBlock
=== CONT TestAccAWSVpc_update
=== CONT TestAccAWSVpc_classiclinkDnsSupportOptionSet
=== CONT TestAccAWSVpc_classiclinkOptionSet
=== CONT TestAccAWSVpc_DisabledDnsSupport
=== CONT TestAccAWSVpc_bothDnsOptionsSet
=== CONT TestAccAWSVpc_Tenancy
=== CONT TestAccAWSVpc_tags
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (28.37s)
=== CONT TestAccAWSVpc_ignoreTags
--- PASS: TestAccAWSVpc_classiclinkOptionSet (34.26s)
=== CONT TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (34.43s)
=== CONT TestAccAWSVpc_DynamicResourceTags_IgnoreChanges
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (42.58s)
=== CONT TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges
--- PASS: TestAccAWSVpc_DisabledDnsSupport (42.72s)
=== CONT TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (2.17s)
=== CONT TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag
--- PASS: TestAccAWSVpc_defaultAndIgnoreTags (56.70s)
=== CONT TestAccAWSVpc_defaultTags_providerOnly
--- PASS: TestAccAWSVpc_update (60.53s)
=== CONT TestAccAWSVpc_defaultTags_updateToResourceOnly
--- PASS: TestAccAWSVpc_DynamicResourceTags_IgnoreChanges (41.44s)
=== CONT TestAccAWSVpc_defaultTags_updateToProviderOnly
--- PASS: TestAccAWSVpc_tags (76.01s)
=== CONT TestAccAWSVpc_disappears
--- PASS: TestAccAWSVpc_ignoreTags (49.21s)
=== CONT TestAccAWSVpc_basic
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (79.19s)
--- PASS: TestAccAWSVpc_Tenancy (80.40s)
--- PASS: TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges (42.79s)
--- PASS: TestAccAWSVpc_disappears (14.63s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (56.53s)
--- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (37.30s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (57.26s)
--- PASS: TestAccAWSVpc_basic (24.72s)
--- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (35.16s)
--- PASS: TestAccAWSVpc_defaultTags_providerOnly (55.45s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 116.036s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSVpc_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSVpc_ -timeout 180m
=== RUN TestAccAWSVpc_coreMismatchedDiffs
=== PAUSE TestAccAWSVpc_coreMismatchedDiffs
=== RUN TestAccAWSVpc_basic
=== PAUSE TestAccAWSVpc_basic
=== RUN TestAccAWSVpc_disappears
=== PAUSE TestAccAWSVpc_disappears
=== RUN TestAccAWSVpc_defaultTags_providerOnly
=== PAUSE TestAccAWSVpc_defaultTags_providerOnly
=== RUN TestAccAWSVpc_defaultTags_updateToProviderOnly
=== PAUSE TestAccAWSVpc_defaultTags_updateToProviderOnly
=== RUN TestAccAWSVpc_defaultTags_updateToResourceOnly
=== PAUSE TestAccAWSVpc_defaultTags_updateToResourceOnly
=== RUN TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag
=== PAUSE TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag
=== RUN TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag
=== PAUSE TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag
=== RUN TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag
=== PAUSE TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag
=== RUN TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges
=== PAUSE TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges
=== RUN TestAccAWSVpc_DynamicResourceTags_IgnoreChanges
=== PAUSE TestAccAWSVpc_DynamicResourceTags_IgnoreChanges
=== RUN TestAccAWSVpc_defaultAndIgnoreTags
=== PAUSE TestAccAWSVpc_defaultAndIgnoreTags
=== RUN TestAccAWSVpc_ignoreTags
=== PAUSE TestAccAWSVpc_ignoreTags
=== RUN TestAccAWSVpc_AssignGeneratedIpv6CidrBlock
=== PAUSE TestAccAWSVpc_AssignGeneratedIpv6CidrBlock
=== RUN TestAccAWSVpc_Tenancy
=== PAUSE TestAccAWSVpc_Tenancy
=== RUN TestAccAWSVpc_tags
=== PAUSE TestAccAWSVpc_tags
=== RUN TestAccAWSVpc_update
=== PAUSE TestAccAWSVpc_update
=== RUN TestAccAWSVpc_bothDnsOptionsSet
=== PAUSE TestAccAWSVpc_bothDnsOptionsSet
=== RUN TestAccAWSVpc_DisabledDnsSupport
=== PAUSE TestAccAWSVpc_DisabledDnsSupport
=== RUN TestAccAWSVpc_classiclinkOptionSet
=== PAUSE TestAccAWSVpc_classiclinkOptionSet
=== RUN TestAccAWSVpc_classiclinkDnsSupportOptionSet
=== PAUSE TestAccAWSVpc_classiclinkDnsSupportOptionSet
=== CONT TestAccAWSVpc_coreMismatchedDiffs
=== CONT TestAccAWSVpc_classiclinkDnsSupportOptionSet
=== CONT TestAccAWSVpc_update
=== CONT TestAccAWSVpc_defaultAndIgnoreTags
=== CONT TestAccAWSVpc_AssignGeneratedIpv6CidrBlock
=== CONT TestAccAWSVpc_tags
=== CONT TestAccAWSVpc_Tenancy
=== CONT TestAccAWSVpc_classiclinkOptionSet
=== CONT TestAccAWSVpc_DisabledDnsSupport
=== CONT TestAccAWSVpc_bothDnsOptionsSet
=== CONT TestAccAWSVpc_defaultTags_providerOnly
=== CONT TestAccAWSVpc_defaultTags_updateToResourceOnly
=== CONT TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag
=== CONT TestAccAWSVpc_basic
=== CONT TestAccAWSVpc_defaultTags_updateToProviderOnly
=== CONT TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag
=== CONT TestAccAWSVpc_ignoreTags
=== CONT TestAccAWSVpc_DynamicResourceTags_IgnoreChanges
=== CONT TestAccAWSVpc_disappears
=== CONT TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (15.79s)
=== CONT TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges
=== CONT TestAccAWSVpc_classiclinkDnsSupportOptionSet
provider_test.go:1115: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
2021/05/06 17:12:50 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.3
Error: error enabling VPC (vpc-027c6daf549f37bef) ClassicLink: UnsupportedOperation: The functionality you requested is not available in this region.
status code: 400, request id: 7855f982-0ae9-43e0-8483-f11e1d67cdab
on terraform_plugin_test.tf line 2, in resource "aws_vpc" "test":
2: resource "aws_vpc" "test" {
=== CONT TestAccAWSVpc_classiclinkOptionSet
provider_test.go:1115: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
2021/05/06 17:12:50 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.3
Error: error enabling VPC (vpc-08f739a943476cbc3) ClassicLink: UnsupportedOperation: The functionality you requested is not available in this region.
status code: 400, request id: 133dfb23-4a99-4055-988d-7e9517aa6adb
on terraform_plugin_test.tf line 2, in resource "aws_vpc" "test":
2: resource "aws_vpc" "test" {
--- SKIP: TestAccAWSVpc_classiclinkDnsSupportOptionSet (21.73s)
--- SKIP: TestAccAWSVpc_classiclinkOptionSet (21.78s)
--- PASS: TestAccAWSVpc_disappears (37.60s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (45.42s)
--- PASS: TestAccAWSVpc_basic (52.51s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (57.30s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (57.75s)
--- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (61.17s)
--- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (69.42s)
--- PASS: TestAccAWSVpc_DynamicResourceTags_IgnoreChanges (72.42s)
--- PASS: TestAccAWSVpc_DynamicResourceTagsMergedWithLocals_IgnoreChanges (58.66s)
--- PASS: TestAccAWSVpc_defaultAndIgnoreTags (79.22s)
--- PASS: TestAccAWSVpc_ignoreTags (82.81s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (83.20s)
--- PASS: TestAccAWSVpc_defaultTags_providerOnly (85.34s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (85.32s)
--- PASS: TestAccAWSVpc_update (85.29s)
--- PASS: TestAccAWSVpc_tags (107.71s)
--- PASS: TestAccAWSVpc_Tenancy (108.01s)
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (108.17s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 113.503s
This has been released in version 3.39.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 for triage. Thanks! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Closes #18366
Notes
timestamp()
) and thelifecycle
ignore_changes
is applied, theSetTagsDiff
CustomizeDiff does not correctly set thetags_all
attribute to new Computed as expected, but rather tries to remove all previous values by setting them tonull
since the result oflen(diff.Get("tags_all").(map[string]interface{}))
is 0.tags_all
Output from acceptance testing (2 new tests created to showcase behavior in #18366 (comment) before code change):
Output from acceptance testing (after code change):