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/sagemaker_domain - new resource #16077

Merged
merged 33 commits into from
Jan 13, 2021

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Nov 6, 2020

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 #14453

Release note for CHANGELOG:

resource_aws_sagemaker_domain - add new resource
resource_aws_sagemaker_image - fix error on wait for delete when image does not exist

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSSagemakerDomain_'
--- PASS: TestAccAWSSagemakerDomain_basic (228.59s)--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings (233.93s)
--- PASS: TestAccAWSSagemakerDomain_disappears (222.39s)
--- PASS: TestAccAWSSagemakerDomain_jupyterServerAppSettings (223.22s)
--- PASS: TestAccAWSSagemakerDomain_sharingSettings (233.47s)
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettings (237.31s)
--- PASS: TestAccAWSSagemakerDomain_securityGroup (288.18s)
--- PASS: TestAccAWSSagemakerDomain_tags (346.14s)
--- PASS: TestAccAWSSagemakerDomain_kms (242.96s)

@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. service/sagemaker Issues and PRs that pertain to the sagemaker service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 6, 2020
@DrFaust92 DrFaust92 added the new-resource Introduces a new resource. label Nov 6, 2020
@DrFaust92 DrFaust92 marked this pull request as ready for review November 8, 2020 09:42
@DrFaust92 DrFaust92 requested a review from a team as a code owner November 8, 2020 09:42
@ewbankkit
Copy link
Contributor

Verified acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_' ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run=TestAccAWSSagemakerDomain_ -timeout 120m
=== RUN   TestAccAWSSagemakerDomain_basic
=== PAUSE TestAccAWSSagemakerDomain_basic
=== RUN   TestAccAWSSagemakerDomain_tags
=== PAUSE TestAccAWSSagemakerDomain_tags
=== RUN   TestAccAWSSagemakerDomain_securityGroup
=== PAUSE TestAccAWSSagemakerDomain_securityGroup
=== RUN   TestAccAWSSagemakerDomain_sharingSettings
=== PAUSE TestAccAWSSagemakerDomain_sharingSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettings
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== PAUSE TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== PAUSE TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_disappears
=== PAUSE TestAccAWSSagemakerDomain_disappears
=== CONT  TestAccAWSSagemakerDomain_basic
--- PASS: TestAccAWSSagemakerDomain_basic (168.39s)
=== CONT  TestAccAWSSagemakerDomain_kernelGatewayAppSettings
--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings (185.72s)
=== CONT  TestAccAWSSagemakerDomain_disappears
--- PASS: TestAccAWSSagemakerDomain_disappears (269.66s)
=== CONT  TestAccAWSSagemakerDomain_jupyterServerAppSettings
--- PASS: TestAccAWSSagemakerDomain_jupyterServerAppSettings (242.89s)
=== CONT  TestAccAWSSagemakerDomain_sharingSettings
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettings
--- PASS: TestAccAWSSagemakerDomain_sharingSettings (185.68s)
=== CONT  TestAccAWSSagemakerDomain_securityGroup
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettings (165.46s)
--- PASS: TestAccAWSSagemakerDomain_securityGroup (195.05s)
=== CONT  TestAccAWSSagemakerDomain_tags
--- PASS: TestAccAWSSagemakerDomain_tags (280.55s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1693.469s

Parallelism set to 1 or else I get errors like

Error: error creating SageMaker domain: ResourceLimitExceeded: The account-level service limit 'Total domains' is 1 Domains, with current utilization of 1 Domains and a request delta of 1 Domains. Please contact AWS support to request an increase for this limit.

@ghost ghost added the documentation Introduces or discusses updates to documentation. label Jan 5, 2021
@DrFaust92
Copy link
Collaborator Author

Rebased + some minor fix in the image resource after using it in tests

@ewbankkit ewbankkit self-assigned this Jan 9, 2021
@ewbankkit
Copy link
Contributor

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_' ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run=TestAccAWSSagemakerDomain_ -timeout 120m
=== RUN   TestAccAWSSagemakerDomain_basic
=== PAUSE TestAccAWSSagemakerDomain_basic
=== RUN   TestAccAWSSagemakerDomain_tags
=== PAUSE TestAccAWSSagemakerDomain_tags
=== RUN   TestAccAWSSagemakerDomain_securityGroup
=== PAUSE TestAccAWSSagemakerDomain_securityGroup
=== RUN   TestAccAWSSagemakerDomain_sharingSettings
=== PAUSE TestAccAWSSagemakerDomain_sharingSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettings
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
=== RUN   TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== PAUSE TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== PAUSE TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_disappears
=== PAUSE TestAccAWSSagemakerDomain_disappears
=== CONT  TestAccAWSSagemakerDomain_basic
--- PASS: TestAccAWSSagemakerDomain_basic (199.52s)
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage (299.01s)
=== CONT  TestAccAWSSagemakerDomain_disappears
--- PASS: TestAccAWSSagemakerDomain_disappears (170.70s)
=== CONT  TestAccAWSSagemakerDomain_jupyterServerAppSettings
--- PASS: TestAccAWSSagemakerDomain_jupyterServerAppSettings (259.91s)
=== CONT  TestAccAWSSagemakerDomain_kernelGatewayAppSettings
--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings (166.19s)
=== CONT  TestAccAWSSagemakerDomain_sharingSettings
    resource_aws_sagemaker_domain_test.go:194: Step 1/2 error: Error running pre-apply refresh: 2021/01/09 15:47:27 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.12.0
        
        Error: Unsupported argument
        
          on config040635969/terraform_plugin_test.tf line 57, in resource "aws_sagemaker_domain" "test":
          57:       domain_output_option = "Allowed"
        
        An argument named "domain_output_option" is not expected here.
        
--- FAIL: TestAccAWSSagemakerDomain_sharingSettings (0.57s)
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettings
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettings (166.36s)
=== CONT  TestAccAWSSagemakerDomain_securityGroup
--- PASS: TestAccAWSSagemakerDomain_securityGroup (187.38s)
=== CONT  TestAccAWSSagemakerDomain_tags
--- PASS: TestAccAWSSagemakerDomain_tags (202.22s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	1651.957s
FAIL
GNUmakefile:27: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@DrFaust92
Copy link
Collaborator Author

Fixed issue with non existent/misused argument and added support for kms_key_id argument.

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 TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_' ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run=TestAccAWSSagemakerDomain_ -timeout 120m
=== RUN   TestAccAWSSagemakerDomain_basic
=== PAUSE TestAccAWSSagemakerDomain_basic
=== RUN   TestAccAWSSagemakerDomain_kms
=== PAUSE TestAccAWSSagemakerDomain_kms
=== RUN   TestAccAWSSagemakerDomain_tags
=== PAUSE TestAccAWSSagemakerDomain_tags
=== RUN   TestAccAWSSagemakerDomain_securityGroup
=== PAUSE TestAccAWSSagemakerDomain_securityGroup
=== RUN   TestAccAWSSagemakerDomain_sharingSettings
=== PAUSE TestAccAWSSagemakerDomain_sharingSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettings
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
=== RUN   TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== PAUSE TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== PAUSE TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_disappears
=== PAUSE TestAccAWSSagemakerDomain_disappears
=== CONT  TestAccAWSSagemakerDomain_basic
--- PASS: TestAccAWSSagemakerDomain_basic (180.67s)
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage (242.06s)
=== CONT  TestAccAWSSagemakerDomain_disappears
--- PASS: TestAccAWSSagemakerDomain_disappears (164.54s)
=== CONT  TestAccAWSSagemakerDomain_jupyterServerAppSettings
--- PASS: TestAccAWSSagemakerDomain_jupyterServerAppSettings (215.70s)
=== CONT  TestAccAWSSagemakerDomain_kernelGatewayAppSettings
--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings (197.69s)
=== CONT  TestAccAWSSagemakerDomain_securityGroup
--- PASS: TestAccAWSSagemakerDomain_securityGroup (199.20s)
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettings
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettings (263.39s)
=== CONT  TestAccAWSSagemakerDomain_sharingSettings
--- PASS: TestAccAWSSagemakerDomain_sharingSettings (170.31s)
=== CONT  TestAccAWSSagemakerDomain_tags
--- PASS: TestAccAWSSagemakerDomain_tags (214.93s)
=== CONT  TestAccAWSSagemakerDomain_kms
--- PASS: TestAccAWSSagemakerDomain_kms (167.24s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	2015.822s

@breathingdust
Copy link
Member

LGTM 🚀 Thanks @DrFaust92!

Verified Acceptance Tests in Commercial (us-west-2)

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_' ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run=TestAccAWSSagemakerDomain_ -timeout 120m
=== RUN   TestAccAWSSagemakerDomain_basic
=== PAUSE TestAccAWSSagemakerDomain_basic
=== RUN   TestAccAWSSagemakerDomain_kms
=== PAUSE TestAccAWSSagemakerDomain_kms
=== RUN   TestAccAWSSagemakerDomain_tags
=== PAUSE TestAccAWSSagemakerDomain_tags
=== RUN   TestAccAWSSagemakerDomain_securityGroup
=== PAUSE TestAccAWSSagemakerDomain_securityGroup
=== RUN   TestAccAWSSagemakerDomain_sharingSettings
=== PAUSE TestAccAWSSagemakerDomain_sharingSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettings
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
=== PAUSE TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
=== RUN   TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== PAUSE TestAccAWSSagemakerDomain_kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== PAUSE TestAccAWSSagemakerDomain_jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_disappears
=== PAUSE TestAccAWSSagemakerDomain_disappears
=== CONT  TestAccAWSSagemakerDomain_basic
--- PASS: TestAccAWSSagemakerDomain_basic (258.25s)
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettingsWithImage (309.42s)
=== CONT  TestAccAWSSagemakerDomain_disappears
--- PASS: TestAccAWSSagemakerDomain_disappears (153.13s)
=== CONT  TestAccAWSSagemakerDomain_jupyterServerAppSettings
--- PASS: TestAccAWSSagemakerDomain_jupyterServerAppSettings (163.91s)
=== CONT  TestAccAWSSagemakerDomain_kernelGatewayAppSettings
--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings (349.73s)
=== CONT  TestAccAWSSagemakerDomain_securityGroup
--- PASS: TestAccAWSSagemakerDomain_securityGroup (325.53s)
=== CONT  TestAccAWSSagemakerDomain_tensorboardAppSettings
--- PASS: TestAccAWSSagemakerDomain_tensorboardAppSettings (246.46s)
=== CONT  TestAccAWSSagemakerDomain_sharingSettings
--- PASS: TestAccAWSSagemakerDomain_sharingSettings (164.01s)
=== CONT  TestAccAWSSagemakerDomain_tags
--- PASS: TestAccAWSSagemakerDomain_tags (199.56s)
=== CONT  TestAccAWSSagemakerDomain_kms
--- PASS: TestAccAWSSagemakerDomain_kms (164.55s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	2336.269s

Verified Acceptance Tests in GovCloud (us-gov-west-1)

SageMaker domains are part of SageMaker studio and as such are not supported in GovCloud. I will create an issue to track the work required to skip these tests when run in that region and link the issue here.

=== CONT  TestAccAWSSagemakerDomain_basic
    resource_aws_sagemaker_domain_test.go:76: Step 1/2 error: Error running apply: 2021/01/13 15:48:21 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.12.0

        Error: error creating SageMaker domain: UnknownOperationException: The requested operation is not supported in the called region.
        	status code: 400, request id: 28cc1e92-93f0-4f19-b6a9-d93ba7ab99f3


--- FAIL: TestAccAWSSagemakerDomain_basic (7.81s)

@breathingdust breathingdust merged commit 1cd057c into hashicorp:master Jan 13, 2021
@github-actions github-actions bot added this to the v3.24.0 milestone Jan 13, 2021
breathingdust added a commit that referenced this pull request Jan 13, 2021
@ghost
Copy link

ghost commented Jan 15, 2021

This has been released in version 3.24.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 Feb 13, 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 Feb 13, 2021
@DrFaust92 DrFaust92 deleted the r/sagemaker_domain branch April 15, 2021 10:38
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. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/sagemaker Issues and PRs that pertain to the sagemaker service. size/XXL 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