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

r/instance: prevent double encoding when updating user_data or user_data_base64 #23362

Merged
merged 3 commits into from
Feb 24, 2022

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Feb 24, 2022

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

Relates #23305
Relates #23315 (comment)

Output from acceptance testing:

--- PASS: TestAccEC2Instance_userDataBase64 (133.10s)
--- PASS: TestAccEC2Instance_userDataBase64_updateWithBashFile (170.21s)
--- PASS: TestAccEC2Instance_userDataBase64_update (174.85s)
--- PASS: TestAccEC2Instance_userDataBase64_updateWithZipFile (175.79s)

--- PASS: TestAccEC2Instance_UserData (100.12s)
--- PASS: TestAccEC2Instance_UserData_update (312.70s)
--- PASS: TestAccEC2Instance_UserData_emptyStringToUnspecified (128.04s)
--- PASS: TestAccEC2Instance_UserData_unspecifiedToEmptyString (129.84s)
--- PASS: TestAccEC2Instance_UserData_stringToEncodedString (196.40s)

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 24, 2022
@anGie44 anGie44 force-pushed the b-ec2-instance-user-data-encoding branch from 58cc8b0 to 86c75cb Compare February 24, 2022 16:30
@github-actions github-actions bot added the verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) label Feb 24, 2022
@anGie44 anGie44 force-pushed the b-ec2-instance-user-data-encoding branch 2 times, most recently from 5dc98e0 to 9c38d4e Compare February 24, 2022 16:48
@github-actions github-actions bot removed the verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) label Feb 24, 2022
@anGie44 anGie44 force-pushed the b-ec2-instance-user-data-encoding branch from 9c38d4e to 846c020 Compare February 24, 2022 16:49
@anGie44 anGie44 added the enhancement Requests to existing resources that expand the functionality or scope. label Feb 24, 2022
@anGie44 anGie44 force-pushed the b-ec2-instance-user-data-encoding branch from ca1b982 to cb97cdc Compare February 24, 2022 17:24
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Feb 24, 2022
@@ -3583,6 +3651,39 @@ func TestAccEC2Instance_UserData_update(t *testing.T) {
})
}

func TestAccEC2Instance_UserData_stringToEncodedString(t *testing.T) {
Copy link
Contributor Author

@anGie44 anGie44 Feb 24, 2022

Choose a reason for hiding this comment

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

this test might not be realistic?

@anGie44 anGie44 marked this pull request as ready for review February 24, 2022 17:28
@anGie44 anGie44 marked this pull request as draft February 24, 2022 17:29
@anGie44 anGie44 marked this pull request as ready for review February 24, 2022 20:51
@ewbankkit
Copy link
Contributor

Relates #18043.

Copy link
Contributor

@ewbankkit ewbankkit left a 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=TestAccEC2Instance_userDataBase64\|TestAccEC2Instance_UserData\|TestAccEC2Instance_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2Instance_userDataBase64\|TestAccEC2Instance_UserData\|TestAccEC2Instance_basic -timeout 180m
=== RUN   TestAccEC2Instance_basic
=== PAUSE TestAccEC2Instance_basic
=== RUN   TestAccEC2Instance_userDataBase64
=== PAUSE TestAccEC2Instance_userDataBase64
=== RUN   TestAccEC2Instance_userDataBase64_updateWithBashFile
=== PAUSE TestAccEC2Instance_userDataBase64_updateWithBashFile
=== RUN   TestAccEC2Instance_userDataBase64_updateWithZipFile
=== PAUSE TestAccEC2Instance_userDataBase64_updateWithZipFile
=== RUN   TestAccEC2Instance_userDataBase64_update
=== PAUSE TestAccEC2Instance_userDataBase64_update
=== RUN   TestAccEC2Instance_UserData
=== PAUSE TestAccEC2Instance_UserData
=== RUN   TestAccEC2Instance_UserData_update
=== PAUSE TestAccEC2Instance_UserData_update
=== RUN   TestAccEC2Instance_UserData_stringToEncodedString
=== PAUSE TestAccEC2Instance_UserData_stringToEncodedString
=== RUN   TestAccEC2Instance_UserData_emptyStringToUnspecified
=== PAUSE TestAccEC2Instance_UserData_emptyStringToUnspecified
=== RUN   TestAccEC2Instance_UserData_unspecifiedToEmptyString
=== PAUSE TestAccEC2Instance_UserData_unspecifiedToEmptyString
=== CONT  TestAccEC2Instance_basic
=== CONT  TestAccEC2Instance_UserData
=== CONT  TestAccEC2Instance_UserData_emptyStringToUnspecified
--- PASS: TestAccEC2Instance_basic (96.48s)
=== CONT  TestAccEC2Instance_UserData_unspecifiedToEmptyString
--- PASS: TestAccEC2Instance_UserData (129.83s)
=== CONT  TestAccEC2Instance_userDataBase64_updateWithZipFile
--- PASS: TestAccEC2Instance_UserData_emptyStringToUnspecified (170.68s)
=== CONT  TestAccEC2Instance_userDataBase64_update
--- PASS: TestAccEC2Instance_UserData_unspecifiedToEmptyString (163.16s)
=== CONT  TestAccEC2Instance_UserData_stringToEncodedString
--- PASS: TestAccEC2Instance_userDataBase64_updateWithZipFile (215.12s)
=== CONT  TestAccEC2Instance_UserData_update
--- PASS: TestAccEC2Instance_userDataBase64_update (214.74s)
=== CONT  TestAccEC2Instance_userDataBase64_updateWithBashFile
--- PASS: TestAccEC2Instance_UserData_stringToEncodedString (235.36s)
=== CONT  TestAccEC2Instance_userDataBase64
--- PASS: TestAccEC2Instance_UserData_update (213.35s)
--- PASS: TestAccEC2Instance_userDataBase64 (116.52s)
--- PASS: TestAccEC2Instance_userDataBase64_updateWithBashFile (235.30s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	627.223s

@anGie44 anGie44 added this to the v4.3.0 milestone Feb 24, 2022
@anGie44 anGie44 merged commit 620e0ef into main Feb 24, 2022
@anGie44 anGie44 deleted the b-ec2-instance-user-data-encoding branch February 24, 2022 23:45
github-actions bot pushed a commit that referenced this pull request Feb 24, 2022
@zrma
Copy link

zrma commented Feb 25, 2022

I can't thank you enough for your help and contribution. 👍 🙇

YakDriver pushed a commit that referenced this pull request Feb 28, 2022
YakDriver pushed a commit that referenced this pull request Feb 28, 2022
@github-actions
Copy link

github-actions bot commented Mar 1, 2022

This functionality has been released in v4.3.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!

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. 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.

3 participants