-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
r/emr studio - new resource #21855
Conversation
befc818
to
6fd0d08
Compare
6fd0d08
to
89e3186
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 🚀.
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
@DrFaust92 Thanks for the contribution 🎉 👏. |
return acctest.ErrorCheckSkipMessagesContaining(t, | ||
"Managed scaling is not available", | ||
"SSO is not enabled", | ||
"Account is not whitelisted to use this feature", |
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.
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) |
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.
Should there be a waiter here?
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.
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) |
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.
Is there a reason you decided to not use CreateStudioWithContext in this new resource? This is just a question.
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.
nope, just inertia from previous PRs. need to start doing that.
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! |
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 #20597.
Output from acceptance testing: