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

feature(sagemaker notebook): Add DirectInternetAccess support #8618

Merged
merged 1 commit into from
Jan 29, 2020
Merged

feature(sagemaker notebook): Add DirectInternetAccess support #8618

merged 1 commit into from
Jan 29, 2020

Conversation

bcatubig
Copy link
Contributor

@bcatubig bcatubig commented May 13, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #0000

Release note for CHANGELOG:

* Add direct_internet_access option to Sagemaker Notebook Resource

Output from acceptance testing:

I'm not able to run tests locally, would need some help with my local go setup

I'm not able to run tests. I will need these to be run by another maintainer.

⌂681% [brandon:~/go … terraform-provider-aws] feature/sagemaker-private-internet-access 1m7s ± make testacc TESTARGS='-run=TestAccAWSSagemakerNotebookInstance_directInternetAccess'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSSagemakerNotebookInstance_directInternetAccess -timeout 120m
main.go:5:2: cannot find package "github.com/terraform-providers/terraform-provider-aws/aws" in any of:
	/Users/brandon/go/src/github.com/bcatubig/terraform-provider-aws/vendor/github.com/terraform-providers/terraform-provider-aws/aws (vendor tree)
	/usr/local/Cellar/go/1.12.1/libexec/src/github.com/terraform-providers/terraform-provider-aws/aws (from $GOROOT)
	/Users/brandon/go/src/github.com/terraform-providers/terraform-provider-aws/aws (from $GOPATH)
make: *** [testacc] Error 1

@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. documentation Introduces or discusses updates to documentation. labels May 13, 2019
@bcatubig bcatubig mentioned this pull request May 13, 2019
@bflad
Copy link
Contributor

bflad commented May 15, 2019

Hi @bcatubig 👋 Is this pull request still work in progress as noted by the title?

Regarding the Go error you're seeing with the acceptance testing, you may find it easiest to move the source code directory outside your GOPATH since we've moved this codebase to using Go Modules. 👍

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. waiting-response Maintainers are waiting on response from community or contributor. labels May 15, 2019
@bcatubig
Copy link
Contributor Author

Hey @bflad -- this is ready for review/feedback. I borked my last PR for this feature by mistake.

I'll try moving the folder

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label May 15, 2019
@rainmanh
Copy link

rainmanh commented Jun 4, 2019

@bcatubig @bflad, any estimate when this will be released please?

@seoane
Copy link

seoane commented Jul 16, 2019

@bflad Greetings, do we have any eta for when this will be released?.
Thank you for everything!

@nywilken nywilken requested a review from ryndaniels July 16, 2019 17:40
@bcatubig bcatubig changed the title [WIP] feature(sagemaker notebook): Add DirectInternetAccess support feature(sagemaker notebook): Add DirectInternetAccess support Jul 23, 2019
@pserrano
Copy link

pserrano commented Oct 25, 2019

Hi,
when this feature will be released? It's very useful because if you need to disable the DirectInternetAccess you can't use terraform to handle this Notebook config
and you should do manually. Any ETA? @ryndaniels @bcatubig

@bcatubig
Copy link
Contributor Author

I'll update this branch with upstream this weekend

@pserrano
Copy link

Any ETA about that?

This commit adds direct_internet_access property to SageMaker resource
@bcatubig
Copy link
Contributor Author

PR has been re-synced with upstream. Commits have also been squashed to a single commit.

@jacoor
Copy link
Contributor

jacoor commented Dec 10, 2019

Any update on state of this PR? Would be very usefull.

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.

It looks like additional merge conflicts had crept in since the last rebase due to some unrelated tagging work being done across many of the resources in the provider. Rather than further delay the introduction of this functionality, we opted to fix those and fix remaining issues as noted below. Thanks for this contribution @bcatubig 🚀

Output from acceptance testing (after adjustments):

--- PASS: TestAccAWSSagemakerNotebookInstance_LifecycleConfigName (309.31s)
--- PASS: TestAccAWSSagemakerNotebookInstance_basic (310.81s)
--- PASS: TestAccAWSSagemakerNotebookInstance_disappears (315.88s)
--- PASS: TestAccAWSSagemakerNotebookInstance_tags (318.47s)
--- PASS: TestAccAWSSagemakerNotebookInstance_update (500.90s)
--- PASS: TestAccAWSSagemakerNotebookInstance_direct_internet_access (613.14s)


resource "aws_subnet" "sagemaker" {
vpc_id = "${aws_vpc.test.id}"
cidr_block = "10.0.0.0/27"
Copy link
Contributor

Choose a reason for hiding this comment

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

This test configuration is currently failing the new testing:

--- FAIL: TestAccAWSSagemakerNotebookInstance_direct_internet_access (19.44s)
    testing.go:640: Step 0 error: errors during apply:

        Error: Error creating subnet: InvalidSubnet.Range: The CIDR '10.0.0.0/27' is invalid.

After updating this argument, the testing was still failing with:

--- FAIL: TestAccAWSSagemakerNotebookInstance_direct_internet_access (21.87s)
    testing.go:640: Step 0 error: errors during apply:

        Error: Error creating Sagemaker Notebook Instance: ValidationException: Check if the security groups are specified

Adding an aws_security_group resource and setting security_groups in the aws_sagemaker_notebook_instance configuration fixed the issue. We will note this requirement in the documentation as well.

@@ -72,6 +73,16 @@ func resourceAwsSagemakerNotebookInstance() *schema.Resource {
ForceNew: true,
},

"direct_internet_access": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the API defaults this attribute to Enabled, this schema also needs Default: sagemaker.DirectInternetAccessEnabled to prevent Terraform from recreating resources which do not have it defined:

--- FAIL: TestAccAWSSagemakerNotebookInstance_basic (301.98s)
    testing.go:640: Step 0 error: After applying this step, the plan was not empty:

        DIFF:

        DESTROY/CREATE: aws_sagemaker_notebook_instance.foo
...
          direct_internet_access: "Enabled" => "" (forces new resource)
...

bflad added a commit that referenced this pull request Jan 29, 2020
…rect_internet_access PR feedback

Reference: #8618

Output from acceptance testing:

```
--- PASS: TestAccAWSSagemakerNotebookInstance_LifecycleConfigName (309.31s)
--- PASS: TestAccAWSSagemakerNotebookInstance_basic (310.81s)
--- PASS: TestAccAWSSagemakerNotebookInstance_disappears (315.88s)
--- PASS: TestAccAWSSagemakerNotebookInstance_tags (318.47s)
--- PASS: TestAccAWSSagemakerNotebookInstance_update (500.90s)
--- PASS: TestAccAWSSagemakerNotebookInstance_direct_internet_access (613.14s)
```
@bflad bflad added this to the v2.47.0 milestone Jan 29, 2020
@bflad bflad merged commit da02cf0 into hashicorp:master Jan 29, 2020
bflad added a commit that referenced this pull request Jan 29, 2020
@ghost
Copy link

ghost commented Jan 30, 2020

This has been released in version 2.47.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 Mar 27, 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 and limited conversation to collaborators Mar 27, 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.

6 participants