-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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_notebook_instance #2999
New Resource: aws_sagemaker_notebook_instance #2999
Conversation
} else { | ||
name = v.(string) | ||
} | ||
|
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.
This else clause is not needed since we return in the error case anyway.
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.
Fixed, I'll fix the training job as well
aa694da
to
c0d40d6
Compare
"github.com/hashicorp/terraform/helper/resource" | ||
"github.com/hashicorp/terraform/helper/schema" | ||
"log" | ||
"time" |
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.
The common pattern in this codebase is to separate stdlib imports from others, so these across this PR should be
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
...
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.
FYI goimports
is the tool that does this automatically (personally I have it setup in my editor on save): https://godoc.org/golang.org/x/tools/cmd/goimports
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.
Thanks both, I'll fix this and the other PR today
c0d40d6
to
4f9e248
Compare
How is this PR going? |
The build has failed due to S3 errors in |
The build error is unrelated to this PR |
Looks like we have a check failing. Were we able to identify the criticality of it? |
@bcornils I'll merge master and build again, the error was unrelated to this change last time I checked |
…endor-notebook-instance
I was missing the sidebar in the docs so I've added it. I've merged master into this branch and the build still fails with this error:
Same issue in PR #2955 |
@bflad can we get some eyes on this PR? |
🙌 |
Any Update on this? working version available yet? |
we've not received any feedback from Hashicorp |
Updates? When will be |
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.
Hello @ddcprg, I'm sorry for the delay on reviewing this PR. This review is fairly large but the design looks great. Feel free to leave any comments on concerns on any of the points mentioned and we'll get this merged in soon
} | ||
|
||
resource "aws_iam_role" "foo" { | ||
name = "terraform-testacc-sagemaker-foo" |
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.
If this test fails, the rest of the tests will fail as well since this name isn't randomized. Do you mind randomizing this and all other names to prevent one test failure bringing the rest of the tests down?
} | ||
|
||
resource "aws_iam_role" "foo" { | ||
name = "terraform-testacc-sagemaker-foo" |
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.
Same randomization note as above
} | ||
|
||
resource "aws_iam_role" "foo" { | ||
name = "terraform-testacc-sagemaker-foo" |
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.
Same randomization note as above.
} | ||
|
||
resource "aws_iam_role" "foo" { | ||
name = "terraform-testacc-sagemaker-foo" |
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.
Same randomization note as above
ForceNew: true, | ||
}, | ||
|
||
"creation_time": { |
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.
I don't believe time attributes carry the most beneficial of information that Terraform needs to keep track of it. Is there a good reason for having it in this resource or can we remove it?
} | ||
log.Printf("[INFO] Stopping Sagemaker training job: %s", d.Id()) | ||
|
||
return resource.Retry(5*time.Minute, func() *resource.RetryError { |
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.
I'd suggest using the StateChangeConf method noted above.
|
||
const sagemakerTestAccSagemakerTrainingJobResourceNamePrefix = "terraform-testacc-" | ||
|
||
func init() { |
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.
It looks like this sweeper is unfinished and unneeded since we can't delete the training job. Do you mind removing this?
trainingJobName := resource.PrefixedUniqueId(sagemakerTestAccSagemakerTrainingJobResourceNamePrefix) | ||
bucketName := resource.PrefixedUniqueId(sagemakerTestAccSagemakerTrainingJobResourceNamePrefix) | ||
|
||
resource.Test(t, resource.TestCase{ |
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.
We can set all of these resource.Test
to resource.ParrallelTest
log.Printf("[ERR] Error setting Stopping Condition: %s", err) | ||
return err | ||
} | ||
if err := d.Set("hyper_parameters", fromStringPMapToTerraformMapSagemaker(&trainingJob.HyperParameters)); err != nil { |
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.
We can use the helper for maps instead of this custom function.
return err | ||
} | ||
|
||
d.Set("tags", tagsToMapSagemaker(tagsOutput.Tags)) |
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.
Just in case, we should check for an error while setting tags
Hey all. These changes from this review are being tracked in a new branch here |
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! |
Helps resolving #2493