-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
AWS Glue worker_type feature #9115
Conversation
@Zambonilli, do you know what the hold up is here on getting this merged in? |
@Zambonilli maybe remove [WIP] from issue title? |
There's 325 open PRs currently for this project so I could only imagine how hard it is to manage that many PRs. Let's cut the team some slack here. I have WIP in the title because I'd like a 2nd set of eyes on this with more experience in Google Go. Can you be that 2nd set of eyes @monnetchr or @avicennax? |
Sure thing, but mind, I'm not terribly experienced in Go either. |
Updated title to remove [WIP] tag. |
Anything need to be done to get these checks to pass? Looks like one was cancelled. |
It's ok to ignore the pr-filter-sync task. As noted above, we're catching up on a pretty hefty PR backlog so I can give this a quick glance but it may take a bit longer to give it a full review. Thanks for your patience! |
Co-Authored-By: Audrey Eschright <[email protected]>
updated the documentation per code review via @aeschright |
This PR should be gtg. |
any plans of merging this PR ? |
ping on this getting merged |
Can this be merged? @aeschright |
yes |
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.
Looks good, @Zambonilli, thank you for submitting this. 🚀 Will address the nits on merge.
Output from acceptance testing:
--- PASS: TestAccAWSGlueJob_MaxCapacity (39.16s)
--- PASS: TestAccAWSGlueJob_Basic (44.86s)
--- PASS: TestAccAWSGlueJob_GlueVersion (53.40s)
--- PASS: TestAccAWSGlueJob_Command (59.63s)
--- PASS: TestAccAWSGlueJob_ExecutionProperty (69.02s)
--- PASS: TestAccAWSGlueJob_WorkerType (77.59s)
--- PASS: TestAccAWSGlueJob_AllocatedCapacity (82.80s)
--- PASS: TestAccAWSGlueJob_Timeout (86.08s)
--- PASS: TestAccAWSGlueJob_Description (92.14s)
--- PASS: TestAccAWSGlueJob_MaxRetries (92.75s)
--- PASS: TestAccAWSGlueJob_DefaultArguments (126.01s)
--- PASS: TestAccAWSGlueJob_SecurityConfiguration (126.53s)
--- PASS: TestAccAWSGlueJob_PythonShell (142.48s)
Type: schema.TypeString, | ||
Optional: true, | ||
ConflictsWith: []string{"allocated_capacity", "max_capacity", "allocated_capacity"}, | ||
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^Standard|G.1X|G.2X`), "Must be one of Standard, G.1X or G.2X. See https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-job.html"), |
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.
Nit: We typically prefer to use the validation.StringInSlice()
functionality coupled with available AWS Go SDK constants for this type of validation, to limit the usage of regular expressions while also setting us up for future auto-generation opportunities, e.g.
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^Standard|G.1X|G.2X`), "Must be one of Standard, G.1X or G.2X. See https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-job.html"), | |
ValidateFunc: validation.StringInSlice([]string{ | |
glue.WorkerTypeG1x, | |
glue.WorkerTypeG2x, | |
glue.WorkerTypeStandard, | |
}, false), |
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 is not formatted through make fmt
. There is two spaces vetween ValidateFunc:
and validation
. It's currently making all PR tests fail.
Here's the diff after pulling the latest master and running make fmt
:
diff --git a/aws/resource_aws_glue_job.go b/aws/resource_aws_glue_job.go
index 19468747d..4e2aa2945 100644
--- a/aws/resource_aws_glue_job.go
+++ b/aws/resource_aws_glue_job.go
@@ -122,7 +122,7 @@ func resourceAwsGlueJob() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"allocated_capacity", "max_capacity"},
- ValidateFunc: validation.StringInSlice([]string{
+ ValidateFunc: validation.StringInSlice([]string{
glue.WorkerTypeG1x,
glue.WorkerTypeG2x,
glue.WorkerTypeStandard,
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 think I ran go fmt
and not make fmt
from the root per the CONTRIBUTING.md's Enhancement/Bugfix to a Resource -> Well-formed Code section. I can run make fmt
and push to the PR.
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.
No problem, fixed by 4e449b0, master is now passing
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.
thank you, sorry for an inconvenience!
"worker_type": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ConflictsWith: []string{"allocated_capacity", "max_capacity", "allocated_capacity"}, |
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.
Nit: allocated_capacity
is declared twice
"number_of_workers": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
ConflictsWith: []string{"allocated_capacity", "max_capacity", "allocated_capacity"}, |
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.
Nit: allocated_capacity
is declared twice
Reference: #9115 (review) Output from acceptance testing: ``` --- PASS: TestAccAWSGlueJob_Basic (20.19s) --- PASS: TestAccAWSGlueJob_Timeout (41.58s) --- PASS: TestAccAWSGlueJob_Command (51.15s) --- PASS: TestAccAWSGlueJob_PythonShell (52.94s) --- PASS: TestAccAWSGlueJob_MaxRetries (57.00s) --- PASS: TestAccAWSGlueJob_MaxCapacity (58.24s) --- PASS: TestAccAWSGlueJob_AllocatedCapacity (67.58s) --- PASS: TestAccAWSGlueJob_GlueVersion (77.25s) --- PASS: TestAccAWSGlueJob_DefaultArguments (78.53s) --- PASS: TestAccAWSGlueJob_Description (82.81s) --- PASS: TestAccAWSGlueJob_ExecutionProperty (90.17s) --- PASS: TestAccAWSGlueJob_WorkerType (91.13s) --- PASS: TestAccAWSGlueJob_SecurityConfiguration (105.39s) ```
This has been released in version 2.39.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! |
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! |
I have little experience in Google Go and would like an experienced set of eyes here. Especially around the logic for
worker_type
&number_of_workers
being required/optional in opposite ofmax_allocation
orallocated_capacity
fields.Community Note
Fixes #8257
Release note for CHANGELOG:
Output from acceptance testing: