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

f/aws_sagemaker_model: adding model attribute for container #15371

Merged
merged 4 commits into from
Oct 27, 2020

Conversation

nikhil-goenka
Copy link
Contributor

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 OR Closes #14891

Release note for CHANGELOG:


Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSSagemakerModel_primaryContainerModeSingle'
--- PASS: TestAccAWSSagemakerModel_primaryContainerModeSingle (112.23s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	114.721s
...

@nikhil-goenka nikhil-goenka requested a review from a team September 27, 2020 14:12
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/sagemaker Issues and PRs that pertain to the sagemaker service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 27, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 27, 2020
@ghost ghost added the documentation Introduces or discusses updates to documentation. label Sep 27, 2020
@nikhil-goenka nikhil-goenka marked this pull request as draft October 2, 2020 10:15
@nikhil-goenka nikhil-goenka marked this pull request as ready for review October 2, 2020 10:15
@DrFaust92 DrFaust92 added 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 Oct 20, 2020
@DrFaust92 DrFaust92 self-assigned this Oct 20, 2020
Copy link
Collaborator

@DrFaust92 DrFaust92 left a comment

Choose a reason for hiding this comment

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

all tests but TestAccAWSSagemakerModel_primaryContainerModeSingle are failing the following way:

=== CONT  TestAccAWSSagemakerModel_primaryContainerEnvironment
    resource_aws_sagemaker_model_test.go:177: After applying this test step, the plan was not empty.
        stdout:
        
        
        An execution plan has been generated and is shown below.
        Resource actions are indicated with the following symbols:
        -/+ destroy and then create replacement
        
        Terraform will perform the following actions:
        
          # aws_sagemaker_model.foo must be replaced
        -/+ resource "aws_sagemaker_model" "foo" {
              ~ arn                      = "arn:aws:sagemaker:us-west-2:544685987707:model/terraform-testacc-sagemaker-model-tqxkp6xb1h" -> (known after apply)
              - enable_network_isolation = false -> null
                execution_role_arn       = "arn:aws:iam::544685987707:role/terraform-testacc-sagemaker-model-tqxkp6xb1h"
              ~ id                       = "terraform-testacc-sagemaker-model-tqxkp6xb1h" -> (known after apply)
                name                     = "terraform-testacc-sagemaker-model-tqxkp6xb1h"
        
              ~ primary_container {
                    environment = {
                        "foo" = "bar"
                    }
                    image       = "174872318107.dkr.ecr.us-west-2.amazonaws.com/kmeans:1"
                  - mode        = "SingleModel" -> null
                }
            }

mode needs to be set as default for SingleModel.

@@ -360,6 +379,10 @@ func flattenContainer(container *sagemaker.ContainerDefinition) []interface{} {

cfg["image"] = *container.Image

if container.Mode != nil {
cfg["mode"] = *container.Mode
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, wrap with aws.StringValue()

@nikhil-goenka
Copy link
Contributor Author

all tests but TestAccAWSSagemakerModel_primaryContainerModeSingle are failing the following way:

=== CONT  TestAccAWSSagemakerModel_primaryContainerEnvironment
    resource_aws_sagemaker_model_test.go:177: After applying this test step, the plan was not empty.
        stdout:
        
        
        An execution plan has been generated and is shown below.
        Resource actions are indicated with the following symbols:
        -/+ destroy and then create replacement
        
        Terraform will perform the following actions:
        
          # aws_sagemaker_model.foo must be replaced
        -/+ resource "aws_sagemaker_model" "foo" {
              ~ arn                      = "arn:aws:sagemaker:us-west-2:544685987707:model/terraform-testacc-sagemaker-model-tqxkp6xb1h" -> (known after apply)
              - enable_network_isolation = false -> null
                execution_role_arn       = "arn:aws:iam::544685987707:role/terraform-testacc-sagemaker-model-tqxkp6xb1h"
              ~ id                       = "terraform-testacc-sagemaker-model-tqxkp6xb1h" -> (known after apply)
                name                     = "terraform-testacc-sagemaker-model-tqxkp6xb1h"
        
              ~ primary_container {
                    environment = {
                        "foo" = "bar"
                    }
                    image       = "174872318107.dkr.ecr.us-west-2.amazonaws.com/kmeans:1"
                  - mode        = "SingleModel" -> null
                }
            }

mode needs to be set as default for SingleModel.

updated the default value and its passing now.

TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSSagemakerModel_primaryContainerEnvironment -timeout 120m
=== RUN TestAccAWSSagemakerModel_primaryContainerEnvironment
=== PAUSE TestAccAWSSagemakerModel_primaryContainerEnvironment
=== CONT TestAccAWSSagemakerModel_primaryContainerEnvironment
--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (62.52s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 65.492s

@DrFaust92
Copy link
Collaborator

@nikhil-goenka lets also add the its the default value the the docs.

@nikhil-goenka
Copy link
Contributor Author

@nikhil-goenka lets also add the its the default value the the docs.

already done

@DrFaust92
Copy link
Collaborator

Missed it 😅 . running tests now.

Copy link
Collaborator

@DrFaust92 DrFaust92 left a comment

Choose a reason for hiding this comment

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

LGTM

--- PASS: TestAccAWSSagemakerModel_networkIsolation (57.62s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (58.01s)
--- PASS: TestAccAWSSagemakerModel_basic (61.42s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModeSingle (61.54s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerHostname (62.15s)
--- PASS: TestAccAWSSagemakerModel_containers (76.41s)
--- PASS: TestAccAWSSagemakerModel_vpcConfig (84.87s)
--- PASS: TestAccAWSSagemakerModel_tags (87.15s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModelDataUrl (96.73s)

@DrFaust92 DrFaust92 removed their assignment Oct 23, 2020
@bflad bflad added this to the v3.13.0 milestone Oct 27, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @nikhil-goenka 🚀

Output from acceptance testing (tags testing previously flaky and unrelated):

--- FAIL: TestAccAWSSagemakerModel_tags (25.48s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerHostname (35.25s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModeSingle (36.71s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModelDataUrl (46.65s)
--- PASS: TestAccAWSSagemakerModel_basic (48.03s)
--- PASS: TestAccAWSSagemakerModel_vpcConfig (50.85s)
--- PASS: TestAccAWSSagemakerModel_containers (52.39s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (53.36s)
--- PASS: TestAccAWSSagemakerModel_networkIsolation (54.68s)

@bflad bflad merged commit fb613dc into hashicorp:master Oct 27, 2020
bflad added a commit that referenced this pull request Oct 27, 2020
@nikhil-goenka nikhil-goenka deleted the f/aws_sagemaker_model branch October 27, 2020 03:23
@ghost
Copy link

ghost commented Oct 29, 2020

This has been released in version 3.13.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 Nov 26, 2020

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 Nov 26, 2020
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. enhancement Requests to existing resources that expand the functionality or scope. service/sagemaker Issues and PRs that pertain to the sagemaker service. size/M 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.

aws_sagemaker_model is missing container attribute Model for multi-model containers
3 participants