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

internal/naming: Do not discard terraform- prefixed name prefixes #17030

Merged
merged 2 commits into from
Feb 2, 2021

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jan 8, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #17017

Release note for CHANGELOG:

* resource/aws_cloudwatch_event_rule: Prevent perpetual differences with `name_prefix` argument values beginning with `terraform-`
* resource/aws_security_group: Prevent perpetual differences with `name_prefix` argument values beginning with `terraform-`

Output from acceptance testing:

--- PASS: TestAccAWSCloudWatchEventRule_basic (70.77s)
--- PASS: TestAccAWSCloudWatchEventRule_description (52.06s)
--- PASS: TestAccAWSCloudWatchEventRule_EventBusName (75.08s)
--- PASS: TestAccAWSCloudWatchEventRule_IsEnabled (68.71s)
--- PASS: TestAccAWSCloudWatchEventRule_Name_Generated (33.92s)
--- PASS: TestAccAWSCloudWatchEventRule_NamePrefix (33.93s)
--- PASS: TestAccAWSCloudWatchEventRule_pattern (50.64s)
--- PASS: TestAccAWSCloudWatchEventRule_role (48.35s)
--- PASS: TestAccAWSCloudWatchEventRule_ScheduleAndPattern (33.93s)
--- PASS: TestAccAWSCloudWatchEventRule_tags (83.41s)

--- PASS: TestAccAWSSecurityGroup_allowAll (39.02s)
--- PASS: TestAccAWSSecurityGroup_basic (38.37s)
--- PASS: TestAccAWSSecurityGroup_change (82.06s)
--- PASS: TestAccAWSSecurityGroup_CIDRandGroups (55.51s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressClassic (13.81s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressVPC (49.44s)
--- PASS: TestAccAWSSecurityGroup_drift (19.07s)
--- PASS: TestAccAWSSecurityGroup_driftComplex (49.44s)
--- PASS: TestAccAWSSecurityGroup_egressConfigMode (74.91s)
--- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (53.22s)
--- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (39.04s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesFalse (682.76s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesTrue (737.58s)
--- PASS: TestAccAWSSecurityGroup_ingressConfigMode (73.28s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic (14.36s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC (39.61s)
--- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (56.36s)
--- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (6.52s)
--- PASS: TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules (48.10s)
--- PASS: TestAccAWSSecurityGroup_IPRangesWithSameRules (35.83s)
--- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (35.09s)
--- PASS: TestAccAWSSecurityGroup_ipv6 (46.26s)
--- PASS: TestAccAWSSecurityGroup_multiIngress (45.44s)
--- PASS: TestAccAWSSecurityGroup_Name_Generated (32.72s)
--- PASS: TestAccAWSSecurityGroup_Name_TerraformPrefix (32.03s)
--- PASS: TestAccAWSSecurityGroup_NamePrefix (34.45s)
--- PASS: TestAccAWSSecurityGroup_NamePrefix_TerraformPrefix (32.44s)
--- PASS: TestAccAWSSecurityGroup_ruleDescription (112.40s)
--- PASS: TestAccAWSSecurityGroup_ruleGathering (57.85s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (71.38s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (88.92s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (81.66s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (72.60s)
--- PASS: TestAccAWSSecurityGroup_rulesDropOnError (72.96s)
--- PASS: TestAccAWSSecurityGroup_self (39.48s)
--- PASS: TestAccAWSSecurityGroup_sourceSecurityGroup (31.15s)
--- PASS: TestAccAWSSecurityGroup_tags (76.38s)
--- PASS: TestAccAWSSecurityGroup_vpc (39.96s)
--- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (45.88s)
--- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (37.04s)

Reference: #17017

Changes:

```
* resource/aws_cloudwatch_event_rule: Prevent perpetual differences with `name_prefix` argument values beginning with `terraform-`
* resource/aws_security_group: Prevent perpetual differences with `name_prefix` argument values beginning with `terraform-`
```

Output from acceptance testing:

```
--- PASS: TestAccAWSCloudWatchEventRule_basic (70.77s)
--- PASS: TestAccAWSCloudWatchEventRule_description (52.06s)
--- PASS: TestAccAWSCloudWatchEventRule_EventBusName (75.08s)
--- PASS: TestAccAWSCloudWatchEventRule_IsEnabled (68.71s)
--- PASS: TestAccAWSCloudWatchEventRule_Name_Generated (33.92s)
--- PASS: TestAccAWSCloudWatchEventRule_NamePrefix (33.93s)
--- PASS: TestAccAWSCloudWatchEventRule_pattern (50.64s)
--- PASS: TestAccAWSCloudWatchEventRule_role (48.35s)
--- PASS: TestAccAWSCloudWatchEventRule_ScheduleAndPattern (33.93s)
--- PASS: TestAccAWSCloudWatchEventRule_tags (83.41s)

--- PASS: TestAccAWSSecurityGroup_allowAll (39.02s)
--- PASS: TestAccAWSSecurityGroup_basic (38.37s)
--- PASS: TestAccAWSSecurityGroup_change (82.06s)
--- PASS: TestAccAWSSecurityGroup_CIDRandGroups (55.51s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressClassic (13.81s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressVPC (49.44s)
--- PASS: TestAccAWSSecurityGroup_drift (19.07s)
--- PASS: TestAccAWSSecurityGroup_driftComplex (49.44s)
--- PASS: TestAccAWSSecurityGroup_egressConfigMode (74.91s)
--- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (53.22s)
--- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (39.04s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesFalse (682.76s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesTrue (737.58s)
--- PASS: TestAccAWSSecurityGroup_ingressConfigMode (73.28s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic (14.36s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC (39.61s)
--- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (56.36s)
--- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (6.52s)
--- PASS: TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules (48.10s)
--- PASS: TestAccAWSSecurityGroup_IPRangesWithSameRules (35.83s)
--- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (35.09s)
--- PASS: TestAccAWSSecurityGroup_ipv6 (46.26s)
--- PASS: TestAccAWSSecurityGroup_multiIngress (45.44s)
--- PASS: TestAccAWSSecurityGroup_Name_Generated (32.72s)
--- PASS: TestAccAWSSecurityGroup_Name_TerraformPrefix (32.03s)
--- PASS: TestAccAWSSecurityGroup_NamePrefix (34.45s)
--- PASS: TestAccAWSSecurityGroup_NamePrefix_TerraformPrefix (32.44s)
--- PASS: TestAccAWSSecurityGroup_ruleDescription (112.40s)
--- PASS: TestAccAWSSecurityGroup_ruleGathering (57.85s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (71.38s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (88.92s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (81.66s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (72.60s)
--- PASS: TestAccAWSSecurityGroup_rulesDropOnError (72.96s)
--- PASS: TestAccAWSSecurityGroup_self (39.48s)
--- PASS: TestAccAWSSecurityGroup_sourceSecurityGroup (31.15s)
--- PASS: TestAccAWSSecurityGroup_tags (76.38s)
--- PASS: TestAccAWSSecurityGroup_vpc (39.96s)
--- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (45.88s)
--- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (37.04s)
```
@bflad bflad added the bug Addresses a defect in current functionality. label Jan 8, 2021
@bflad bflad requested a review from a team as a code owner January 8, 2021 20:53
@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/cloudwatchevents service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 8, 2021
Base automatically changed from master to main January 23, 2021 01:00
@gdavison gdavison self-assigned this Feb 1, 2021
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

--- PASS: TestGenerateIAMPassword (0.00s)
--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidTypeError (8.62s)
--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidCIDR (15.44s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Source_With_Account_Id (64.90s)
--- PASS: TestAccAWSCloudWatchEventRule_NamePrefix (67.63s)
--- PASS: TestAccAWSCloudWatchEventRule_Name_Generated (70.44s)
--- PASS: TestAccAWSCloudWatchEventRule_ScheduleAndPattern (71.27s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Ipv6 (71.40s)
--- PASS: TestAccAWSSecurityGroupRule_Egress (72.22s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_VPC (72.39s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Classic (72.90s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Protocol (73.31s)
--- PASS: TestAccAWSSecurityGroupRule_MultiIngress (73.18s)
--- PASS: TestAccAWSSecurityGroupRule_SelfReference (74.31s)
--- PASS: TestAccAWSCloudWatchEventRule_role (87.03s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_Source (74.38s)
--- PASS: TestProtocolStateFunc (0.00s)
--- PASS: TestProtocolForValue (0.01s)
--- PASS: TestResourceAwsSecurityGroupExpandCollapseRules (0.00s)
--- PASS: TestResourceAwsSecurityGroupIPPermGather (0.00s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_basic (91.56s)
--- PASS: TestAccAWSCloudWatchEventRule_description (115.54s)
--- PASS: TestAccAWSCloudWatchEventRule_pattern (117.97s)
--- PASS: TestAccAWSSecurityGroupRule_MultipleRuleSearching_AllProtocolCrash (60.04s)
--- PASS: TestAccAWSSecurityGroupRule_Issue5310 (71.39s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription (68.21s)
--- PASS: TestAccAWSSecurityGroupRule_SelfSource (70.00s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription (69.98s)
--- PASS: TestAccAWSSecurityGroupRule_PrefixListEgress (83.69s)
--- PASS: TestAccAWSSecurityGroup_allowAll (67.73s)
--- PASS: TestAccAWSCloudWatchEventRule_EventBusName (164.15s)
--- PASS: TestAccAWSCloudWatchEventRule_IsEnabled (164.94s)
--- PASS: TestAccAWSSecurityGroup_sourceSecurityGroup (73.62s)
--- PASS: TestAccAWSCloudWatchEventRule_basic (178.48s)
--- PASS: TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules (74.09s)
--- PASS: TestAccAWSSecurityGroup_IPRangesWithSameRules (72.10s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts (118.16s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription_updates (119.55s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription_updates (121.97s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts (122.70s)
--- PASS: TestAccAWSCloudWatchEventRule_tags (210.90s)
--- PASS: TestAccAWSSecurityGroup_basic (81.68s)
--- PASS: TestAccAWSSecurityGroup_ruleGathering (88.35s)
--- SKIP: TestAccAWSSecurityGroup_defaultEgressClassic (2.26s)
--- PASS: TestAccAWSSecurityGroup_Name_TerraformPrefix (70.51s)
--- PASS: TestAccAWSSecurityGroup_Name_Generated (72.18s)
--- PASS: TestAccAWSSecurityGroup_ipv6 (79.28s)
--- PASS: TestAccAWSSecurityGroup_NamePrefix (70.67s)
--- PASS: TestAccAWSSecurityGroup_NamePrefix_TerraformPrefix (68.12s)
--- PASS: TestAccAWSSecurityGroupRule_Race (181.38s)
--- SKIP: TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic (2.43s)
--- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (21.31s)
--- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (72.72s)
--- PASS: TestAccAWSSecurityGroup_vpc (75.00s)
--- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (75.33s)
--- PASS: TestAccAWSSecurityGroup_self (77.37s)
--- PASS: TestAccAWSSecurityGroup_multiIngress (76.29s)
--- PASS: TestAccAWSSecurityGroupRule_MultiDescription (193.89s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressVPC (69.63s)
--- PASS: TestAccAWSSecurityGroup_drift (58.84s)
--- PASS: TestAccAWSSecurityGroup_driftComplex (62.74s)
--- PASS: TestAccAWSSecurityGroup_egressConfigMode (162.05s)
--- PASS: TestAccAWSSecurityGroup_ingressConfigMode (162.11s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC (60.48s)
--- PASS: TestAccAWSSecurityGroup_CIDRandGroups (61.88s)
--- PASS: TestAccAWSSecurityGroup_change (119.00s)
--- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (50.34s)
--- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (52.89s)
--- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (68.35s)
--- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (65.58s)
--- PASS: TestAccAWSSecurityGroup_ruleDescription (132.22s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (74.47s)
--- PASS: TestAccAWSSecurityGroup_tags (101.14s)
--- PASS: TestAccAWSSecurityGroup_rulesDropOnError (57.10s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (90.10s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (89.19s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (81.40s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesFalse (709.97s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesTrue (730.97s)

@bflad bflad merged commit 51c2305 into main Feb 2, 2021
@bflad bflad deleted the b-naming-prefix-computed branch February 2, 2021 20:21
@github-actions github-actions bot added this to the v3.27.0 milestone Feb 2, 2021
github-actions bot pushed a commit that referenced this pull request Feb 2, 2021
@ghost
Copy link

ghost commented Feb 5, 2021

This has been released in version 3.27.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!

@ghost
Copy link

ghost commented Mar 5, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Groups with name or name_prefix starting with "terraform-" get recreated every time
3 participants