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

feat: Add encryption_key_arn arg for aws_emr_studio #40771

Merged

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Jan 4, 2025

Description

This PR is primarily to add the encryption_key_arn argument to the aws_emr_studio resource to support workspace storage encryption. While working on this PR, I also saw test cases failing because of a regression issue with eventual consistency handling. The error message for detecting eventual consistency changed, so it wasn't handled. I have fixed this issue as well.

I also saw a missing policy from the IAM role. While it does not cause issue with testing Terraform per se, for it to be a fully functional test case I've added it.

Lastly, I noticed that any SSO-related test cases are skipped as my test account does not have IDC enabled. I'd imagine that this is typical for many developers. As such, I've changed all test cases that are not directly testing SSO to use the IAM auth mode instead. Consequently there is one test case TestAccEMRStudio_sso that I couldn't verify due to the lack of IDC - please help with testing that. Thanks.

Relations

Closes #40743

References

Referred to CreateStudio for specs and wordings.

Output from Acceptance Testing

Note: I don't have an account with IDC enabled, so I cannot test that skipped use case.

$ make testacc TESTS=TestAccEMRStudio_ PKG=emr
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/emr/... -v -count 1 -parallel 20 -run='TestAccEMRStudio_'  -timeout 360m
2025/01/04 02:33:06 Initializing Terraform AWS Provider...
=== RUN   TestAccEMRStudio_sso
=== PAUSE TestAccEMRStudio_sso
=== RUN   TestAccEMRStudio_iam
=== PAUSE TestAccEMRStudio_iam
=== RUN   TestAccEMRStudio_disappears
=== PAUSE TestAccEMRStudio_disappears
=== RUN   TestAccEMRStudio_workspaceStorageEncryption
=== PAUSE TestAccEMRStudio_workspaceStorageEncryption
=== RUN   TestAccEMRStudio_tags
=== PAUSE TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_sso
=== CONT  TestAccEMRStudio_workspaceStorageEncryption
=== CONT  TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_disappears
=== CONT  TestAccEMRStudio_iam
=== NAME  TestAccEMRStudio_sso
    acctest.go:1716: skipping test for aws/us-west-2: Error running apply: exit status 1

        Error: creating EMR Studio (tf-acc-test-4819618936344589618): operation error EMR: CreateStudio, https response error StatusCode: 400, RequestID: 3135729d-023a-4b08-8a29-b4c829bfca42, InvalidRequestException: IAM Identity Center is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: d1372339-5f61-48d7-9f9c-43831273f95e; Proxy: null)

          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 107, in resource "aws_emr_studio" "test":
         107: resource "aws_emr_studio" "test" {

=== NAME  TestAccEMRStudio_disappears
    acctest.go:1716: skipping test for aws/us-west-2: Error running apply: exit status 1

        Error: creating EMR Studio (tf-acc-test-8916473171495920686): operation error EMR: CreateStudio, https response error StatusCode: 400, RequestID: 037faException; Request ID: 2f519690-6b6d-4319-925e-a212e519a82e; Proxy: null)

          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 107, in resource "aws_emr_studio" "test":
         107: resource "aws_emr_studio" "test" {

--- SKIP: TestAccEMRStudio_disappears (21.57s)
--- SKIP: TestAccEMRStudio_sso (21.58s)
--- PASS: TestAccEMRStudio_iam (37.12s)
--- PASS: TestAccEMRStudio_workspaceStorageEncryption (43.33s)
--- PASS: TestAccEMRStudio_tags (67.97s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/emr        68.211s

@acwwat acwwat requested a review from a team as a code owner January 4, 2025 07:47
Copy link

github-actions bot commented Jan 4, 2025

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/emr Issues and PRs that pertain to the emr service. needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Jan 4, 2025
@acwwat acwwat force-pushed the f-aws_emr_studio-add_enryption_key_arn_arg branch from 15a79c3 to 73afc53 Compare January 4, 2025 07:50
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 6, 2025
@ewbankkit ewbankkit self-assigned this Jan 6, 2025
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 6, 2025
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=TestAccEMRStudio_' PKG=emr 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/emr/... -v -count 1 -parallel 3  -run=TestAccEMRStudio_ -timeout 360m
2025/01/06 14:15:22 Initializing Terraform AWS Provider...
=== RUN   TestAccEMRStudio_sso
=== PAUSE TestAccEMRStudio_sso
=== RUN   TestAccEMRStudio_iam
=== PAUSE TestAccEMRStudio_iam
=== RUN   TestAccEMRStudio_disappears
=== PAUSE TestAccEMRStudio_disappears
=== RUN   TestAccEMRStudio_workspaceStorageEncryption
=== PAUSE TestAccEMRStudio_workspaceStorageEncryption
=== RUN   TestAccEMRStudio_tags
=== PAUSE TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_sso
=== CONT  TestAccEMRStudio_workspaceStorageEncryption
=== CONT  TestAccEMRStudio_tags
=== NAME  TestAccEMRStudio_sso
    acctest.go:1716: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: creating EMR Studio (tf-acc-test-8281979099833700021): operation error EMR: CreateStudio, https response error StatusCode: 400, RequestID: e2df537b-67bd-4bd5-99a1-47d64776fe16, InvalidRequestException: IAM Identity Center is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 88c8a58b-c76c-4276-b834-d1e99afd55ca; Proxy: null)
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 107, in resource "aws_emr_studio" "test":
         107: resource "aws_emr_studio" "test" {
        
--- SKIP: TestAccEMRStudio_sso (19.39s)
=== CONT  TestAccEMRStudio_disappears
    acctest.go:1716: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: creating EMR Studio (tf-acc-test-3796633636027730642): operation error EMR: CreateStudio, https response error StatusCode: 400, RequestID: 4cad826c-87fd-411d-bcda-0024038a31c7, InvalidRequestException: IAM Identity Center is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: dd08d96e-089e-4e25-8126-0dd951f39ffd; Proxy: null)
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 107, in resource "aws_emr_studio" "test":
         107: resource "aws_emr_studio" "test" {
        
--- SKIP: TestAccEMRStudio_disappears (17.76s)
=== CONT  TestAccEMRStudio_iam
--- PASS: TestAccEMRStudio_workspaceStorageEncryption (37.38s)
--- PASS: TestAccEMRStudio_tags (55.90s)
--- PASS: TestAccEMRStudio_iam (29.82s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/emr	72.289s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit f68c5aa into hashicorp:main Jan 6, 2025
61 checks passed
@github-actions github-actions bot added this to the v5.83.0 milestone Jan 6, 2025
Copy link

github-actions bot commented Jan 9, 2025

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!

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 9, 2025
@acwwat acwwat deleted the f-aws_emr_studio-add_enryption_key_arn_arg branch January 17, 2025 03:21
@acwwat acwwat restored the f-aws_emr_studio-add_enryption_key_arn_arg branch January 17, 2025 03:21
@acwwat acwwat deleted the f-aws_emr_studio-add_enryption_key_arn_arg branch January 17, 2025 03:22
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. documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. external-maintainer Contribution from a trusted external contributor. service/emr Issues and PRs that pertain to the emr service. 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.

[Enhancement]: aws_emr_studio add encryption_key_arn config
2 participants