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

New Resource: aws_sagemaker_model #2478

Merged

Conversation

jckuester
Copy link
Contributor

@jckuester jckuester commented Nov 30, 2017

Add the resource aws_sagemaker_model for the newly announced service called SageMaker:

  • documentation/website
  • implementation of CRUD operations
  • acceptance tests

Acceptance tests

$ make testacc TESTARGS='-run=TestAccAWSSagemakerModel_*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSSagemakerModel_* -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSSagemakerModel_basic
--- PASS: TestAccAWSSagemakerModel_basic (65.17s)
=== RUN   TestAccAWSSagemakerModel_tags
--- PASS: TestAccAWSSagemakerModel_tags (101.68s)
=== RUN   TestAccAWSSagemakerModel_primaryContainerModelDataUrl
--- PASS: TestAccAWSSagemakerModel_primaryContainerModelDataUrl (113.42s)
=== RUN   TestAccAWSSagemakerModel_primaryContainerHostname
--- PASS: TestAccAWSSagemakerModel_primaryContainerHostname (63.63s)
=== RUN   TestAccAWSSagemakerModel_primaryContainerEnvironment
--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (64.25s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	408.175s

Updates

  • 24th Apr 2018: Rebase on master branch

@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from 1d5347f to 18a6eaa Compare November 30, 2017 12:07
@jckuester jckuester mentioned this pull request Nov 30, 2017
@radeksimko radeksimko added the new-resource Introduces a new resource. label Nov 30, 2017
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 2 times, most recently from 4fe7010 to e41d067 Compare December 1, 2017 23:44
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from 24b6718 to 48fd36a Compare December 3, 2017 15:54
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 2 times, most recently from 17e732d to f7be35d Compare December 10, 2017 14:21
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from f7be35d to f4d0931 Compare December 12, 2017 17:03
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from 4386895 to 8ba124e Compare December 12, 2017 17:14
@jckuester jckuester changed the title [WIP] Support new resource: sagemaker model Support new resource: sagemaker model Dec 12, 2017
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 5 times, most recently from 0907783 to 7468b70 Compare December 18, 2017 11:23
@jckuester
Copy link
Contributor Author

jckuester commented Jan 7, 2018

@radeksimko waiting for feedback on this PR :-) Thanks.

@radeksimko radeksimko added the service/sagemaker Issues and PRs that pertain to the sagemaker service. label Jan 16, 2018
@radeksimko radeksimko changed the title Support new resource: sagemaker model New Resource: aws_sagemaker_model Jan 16, 2018
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 2 times, most recently from 6c17182 to 643b09b Compare January 21, 2018 00:26
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from 643b09b to 4940787 Compare February 13, 2018 14:40
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Feb 13, 2018
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from 4940787 to 1a815f3 Compare February 14, 2018 10:49
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Feb 14, 2018
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 2 times, most recently from 650aba6 to 52d9a31 Compare January 3, 2019 21:34
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Doing a final pass against the latest code commits. It looks like a needed function was removed

Check: resource.ComposeTestCheckFunc(
testAccCheckSagemakerModelExists("aws_sagemaker_model.foo"),
Copy link
Member

Choose a reason for hiding this comment

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

Hey @jckuester, was there any reason why this and the corresponding method was removed? It's a fairly important check for the tests

Copy link
Contributor Author

@jckuester jckuester Jan 7, 2019

Choose a reason for hiding this comment

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

Readded.

@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 2 times, most recently from e9626f3 to b5a5549 Compare January 12, 2019 21:11
@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch 2 times, most recently from 6ad9a40 to 4049269 Compare January 21, 2019 16:30
@jckuester
Copy link
Contributor Author

jckuester commented Jan 21, 2019

@mbfrahry I guess, I addressed all your comments and ran the tests (which are green now). I hope we are ready to go :)

Somehow the linter fails (https://travis-ci.org/terraform-providers/terraform-provider-aws/builds/482829006#L512) with gometalinter: error: unknown linters: unused, gosimple. However, I guess, it's not cause by this PR.

@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from 4049269 to d64ad64 Compare January 22, 2019 10:54
@mbfrahry
Copy link
Member

Hey @jckuester, apologies for making some minor changes to the PR. The changes you've made look great and I just made one more comment if you don't mind looking at it and then we can merge it in

@jckuester
Copy link
Contributor Author

jckuester commented Jan 24, 2019

@mbfrahry ok, cool. Thanks for your changes. I guess, we are ready then :)

Update: I rebased the branch, @mbfrahry, and the checks have passed now.

@jckuester jckuester force-pushed the feature/resource-aws-sagemaker-model branch from de5f4b9 to 73037d5 Compare February 6, 2019 18:53
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.

Pulling this in so we can get this released today and will make the very minor changes below on merge. Thanks so much for sticking through this one @jckuester and @mbfrahry! 🚀

Output from acceptance testing:

--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (23.40s)
--- PASS: TestAccAWSSagemakerModel_basic (23.70s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerHostname (23.82s)
--- PASS: TestAccAWSSagemakerModel_tags (32.58s)
--- PASS: TestAccAWSSagemakerModel_containers (33.86s)
--- PASS: TestAccAWSSagemakerModel_networkIsolation (35.85s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModelDataUrl (39.13s)
--- PASS: TestAccAWSSagemakerModel_vpcConfig (39.20s)

website/docs/r/sagemaker_model.html.markdown Show resolved Hide resolved
Provides a SageMaker model resource.
---

# aws\_sagemaker\_model
Copy link
Contributor

Choose a reason for hiding this comment

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

Backslashes in resource documentation titles were removed from the codebase awhile ago. Presumably this PR predates that cleanup.

image = "%s"
}

tags {
Copy link
Contributor

Choose a reason for hiding this comment

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

An equals sign will be required here in Terraform 0.12 and is backwards compatible with Terraform 0.11. For operators, this configuration update will be detected with the terraform 0.12upgrade command.

  tags = {

Config: testAccSagemakerModelConfigTags(rName, image),
Check: resource.ComposeTestCheckFunc(
testAccCheckSagemakerModelExists("aws_sagemaker_model.foo"),
resource.TestCheckResourceAttr("aws_sagemaker_model.foo", "tags.%", "1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

This check seems flakey, but only in CI. Passes fine locally. May be some sort of eventual consistency issue.

--- FAIL: TestAccAWSSagemakerModel_tags (17.66s)
    testing.go:538: Step 0 error: Check failed: Check 2/3 error: aws_sagemaker_model.foo: Attribute 'tags.%' expected "1", got "0"

func TestAccAWSSagemakerModel_primaryContainerEnvironment(t *testing.T) {
rName := acctest.RandString(10)

resource.Test(t, resource.TestCase{
Copy link
Contributor

Choose a reason for hiding this comment

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

Likely well after this pull request was introduced, we switched the majority of the codebase acceptance testing from resource.Test() to resource.ParallelTest()

func TestAccAWSSagemakerModel_containers(t *testing.T) {
rName := acctest.RandString(10)

resource.Test(t, resource.TestCase{
Copy link
Contributor

Choose a reason for hiding this comment

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

Likely well after this pull request was introduced, we switched the majority of the codebase acceptance testing from resource.Test() to resource.ParallelTest()

---
layout: "aws"
page_title: "AWS: sagemaker_model"
sidebar_current: "docs-aws-resource-sagemaker-model"
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation page is missing a sidebar link in website/aws.erb

                        <li<%= sidebar_current("docs-aws-resource-sagemaker-model") %>>
                          <a href="/docs/providers/aws/r/sagemaker_model.html">aws_sagemaker_model</a>
                        </li>

primary_container {
image = "%s"

environment {
Copy link
Contributor

Choose a reason for hiding this comment

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

An equals sign will be required here in Terraform 0.12 and is backwards compatible with Terraform 0.11. For operators, this configuration update will be detected with the terraform 0.12upgrade command.

  environment = {

image = "%s"
}

tags {
Copy link
Contributor

Choose a reason for hiding this comment

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

An equals sign will be required here in Terraform 0.12 and is backwards compatible with Terraform 0.11. For operators, this configuration update will be detected with the terraform 0.12upgrade command.

  tags = {

@bflad bflad added this to the v1.58.0 milestone Feb 7, 2019
@bflad bflad merged commit 252964d into hashicorp:master Feb 7, 2019
bflad added a commit that referenced this pull request Feb 7, 2019
Output from acceptance testing:

```
--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (23.40s)
--- PASS: TestAccAWSSagemakerModel_basic (23.70s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerHostname (23.82s)
--- PASS: TestAccAWSSagemakerModel_tags (32.58s)
--- PASS: TestAccAWSSagemakerModel_containers (33.86s)
--- PASS: TestAccAWSSagemakerModel_networkIsolation (35.85s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModelDataUrl (39.13s)
--- PASS: TestAccAWSSagemakerModel_vpcConfig (39.20s)
```
bflad added a commit that referenced this pull request Feb 7, 2019
@bflad
Copy link
Contributor

bflad commented Feb 8, 2019

This has been released in version 1.58.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@LarsNeR
Copy link

LarsNeR commented Aug 1, 2019

@bflad @jckuester Is it intended that the field subnets in vpc_config is called subnets and not subnet_ids like in lambda_function and eks_cluster. Stumpled upon that because I searched for the fields in vpc_config and did not find them in the documentation so I checked how they are called in other resources. I guess it is not possible to change it now because it is already realeased, right?

@ghost
Copy link

ghost commented Nov 2, 2019

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 and limited conversation to collaborators Nov 2, 2019
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.

6 participants