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/emr studio - new resource #21855

Merged
merged 6 commits into from
Dec 7, 2021
Merged

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Nov 19, 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 #20597.

Output from acceptance testing:

$ make testacc TESTS=TestAccEMRStudio_ PKG=emr

--- PASS: TestAccEMRStudio_disappears (79.81s)
--- PASS: TestAccEMRStudio_sso (85.61s)
--- PASS: TestAccEMRStudio_tags (201.09s)
--- PASS: TestAccEMRStudio_iam (109.14s)

@github-actions github-actions bot added size/XL 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/ec2 Issues and PRs that pertain to the ec2 service. service/emr Issues and PRs that pertain to the emr service. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 19, 2021
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 🚀.

AWS Commercial account with SSO enabled
% make testacc TESTS=TestAccEMRStudio_ PKG=emr
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/emr/... -v -count 1 -parallel 20 -run='TestAccEMRStudio_' -timeout 180m
=== RUN   TestAccEMRStudio_sso
=== PAUSE TestAccEMRStudio_sso
=== RUN   TestAccEMRStudio_iam
=== PAUSE TestAccEMRStudio_iam
=== RUN   TestAccEMRStudio_disappears
=== PAUSE TestAccEMRStudio_disappears
=== RUN   TestAccEMRStudio_tags
=== PAUSE TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_sso
=== CONT  TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_disappears
=== CONT  TestAccEMRStudio_iam
--- PASS: TestAccEMRStudio_disappears (41.06s)
--- PASS: TestAccEMRStudio_iam (42.37s)
--- PASS: TestAccEMRStudio_sso (67.39s)
--- PASS: TestAccEMRStudio_tags (85.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/emr	89.000s
AWS Commercial account without SSO enabled
% make testacc TESTS=TestAccEMRStudio_ PKG=emr
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/emr/... -v -count 1 -parallel 20 -run='TestAccEMRStudio_' -timeout 180m
=== RUN   TestAccEMRStudio_sso
=== PAUSE TestAccEMRStudio_sso
=== RUN   TestAccEMRStudio_iam
=== PAUSE TestAccEMRStudio_iam
=== RUN   TestAccEMRStudio_disappears
=== PAUSE TestAccEMRStudio_disappears
=== RUN   TestAccEMRStudio_tags
=== PAUSE TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_sso
=== CONT  TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_disappears
=== CONT  TestAccEMRStudio_iam
=== CONT  TestAccEMRStudio_tags
    acctest.go:960: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: error creating EMR Studio: InvalidRequestException: SSO is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 8282038c-c3a4-40da-b092-3ac8114434ae; Proxy: null)
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "19c33a06-7189-4c73-a979-ef3a92c0e2fc"
          },
          Message_: "SSO is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 8282038c-c3a4-40da-b092-3ac8114434ae; Proxy: null)"
        }
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
=== CONT  TestAccEMRStudio_disappears
    acctest.go:960: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: error creating EMR Studio: InvalidRequestException: SSO is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 8adde1ba-85dd-4054-8e65-46cbe40ba0c7; Proxy: null)
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "5eed9ffd-9953-4954-8445-b932a91e83ef"
          },
          Message_: "SSO is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 8adde1ba-85dd-4054-8e65-46cbe40ba0c7; Proxy: null)"
        }
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
=== CONT  TestAccEMRStudio_sso
    acctest.go:960: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: error creating EMR Studio: InvalidRequestException: SSO is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 1cf177cc-1be3-4817-ab7d-026f4071fc64; Proxy: null)
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "963bab2d-ef92-4b89-8792-58a66c51ba2b"
          },
          Message_: "SSO is not enabled (Service: AWSEditors; Status Code: 400; Error Code: InvalidRequestException; Request ID: 1cf177cc-1be3-4817-ab7d-026f4071fc64; Proxy: null)"
        }
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
--- SKIP: TestAccEMRStudio_tags (28.37s)
--- SKIP: TestAccEMRStudio_disappears (28.38s)
--- SKIP: TestAccEMRStudio_sso (28.44s)
--- PASS: TestAccEMRStudio_iam (42.65s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/emr	45.931s
US GovCloud
% make testacc TESTS=TestAccEMRStudio_ PKG=emr                
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/emr/... -v -count 1 -parallel 20 -run='TestAccEMRStudio_' -timeout 180m
=== RUN   TestAccEMRStudio_sso
=== PAUSE TestAccEMRStudio_sso
=== RUN   TestAccEMRStudio_iam
=== PAUSE TestAccEMRStudio_iam
=== RUN   TestAccEMRStudio_disappears
=== PAUSE TestAccEMRStudio_disappears
=== RUN   TestAccEMRStudio_tags
=== PAUSE TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_sso
=== CONT  TestAccEMRStudio_tags
=== CONT  TestAccEMRStudio_disappears
=== CONT  TestAccEMRStudio_iam
    acctest.go:960: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EMR Studio: ValidationException: Account is not whitelisted to use this feature.
        	status code: 400, request id: e4f12c9a-4fed-497b-a445-1249f4c0102c
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
=== CONT  TestAccEMRStudio_sso
    acctest.go:960: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EMR Studio: ValidationException: Account is not whitelisted to use this feature.
        	status code: 400, request id: 957b6542-2bf6-435f-9c1e-eb3f49bfcb7b
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
=== CONT  TestAccEMRStudio_tags
    acctest.go:960: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EMR Studio: ValidationException: Account is not whitelisted to use this feature.
        	status code: 400, request id: 1f6b5210-a2e6-4119-8b9d-b9648e6369ac
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
=== CONT  TestAccEMRStudio_disappears
    acctest.go:960: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating EMR Studio: ValidationException: Account is not whitelisted to use this feature.
        	status code: 400, request id: 60088379-ab72-4da7-b23c-6d2ef6425160
        
          with aws_emr_studio.test,
          on terraform_plugin_test.tf line 74, in resource "aws_emr_studio" "test":
          74: resource "aws_emr_studio" "test" {
        
--- SKIP: TestAccEMRStudio_sso (19.37s)
--- SKIP: TestAccEMRStudio_iam (19.45s)
--- SKIP: TestAccEMRStudio_tags (19.45s)
--- SKIP: TestAccEMRStudio_disappears (19.48s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/emr	23.010s

@ewbankkit
Copy link
Contributor

@DrFaust92 Thanks for the contribution 🎉 👏.
In general everything was great.
I modified some of the acceptance tests configurations and error checking.

@ewbankkit ewbankkit merged commit 5fc93b3 into hashicorp:main Dec 7, 2021
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 7, 2021
return acctest.ErrorCheckSkipMessagesContaining(t,
"Managed scaling is not available",
"SSO is not enabled",
"Account is not whitelisted to use this feature",
Copy link
Collaborator

Choose a reason for hiding this comment

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

AWS has deprecated the use of the terms "whitelist" and "blacklist" in favor of "allow-list" and "deny-list".

}

log.Printf("[INFO] Deleting EMR Studio: %s", d.Id())
_, err := conn.DeleteStudio(request)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be a waiter here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

doesnt look like studio exposes any status attribute so no, also the post destroy checks pass

return nil
})
if tfresource.TimedOut(err) {
result, err = conn.CreateStudio(input)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason you decided to not use CreateStudioWithContext in this new resource? This is just a question.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nope, just inertia from previous PRs. need to start doing that.

@DrFaust92 DrFaust92 deleted the r/emr_studio branch December 9, 2021 20:22
@github-actions
Copy link

This functionality has been released in v3.69.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

github-actions bot commented Jun 3, 2022

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 Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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. service/emr Issues and PRs that pertain to the emr service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. 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.

Amazon EMR Studio
3 participants