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

Fix aws_glue_job resource attribute #7340

Conversation

teraken0509
Copy link
Contributor

@teraken0509 teraken0509 commented Jan 26, 2019

Fixes #7325

Changes proposed in this pull request:

  • Add support for pythonshell
  • Change allocated_capacity attribute to deprecated
    • Remove Default value of allocated_capacity

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSGlueJob_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSGlueJob_ -timeout 120m
=== RUN   TestAccAWSGlueJob_Basic
=== PAUSE TestAccAWSGlueJob_Basic
=== RUN   TestAccAWSGlueJob_AllocatedCapacity
=== PAUSE TestAccAWSGlueJob_AllocatedCapacity
=== RUN   TestAccAWSGlueJob_Command
=== PAUSE TestAccAWSGlueJob_Command
=== RUN   TestAccAWSGlueJob_DefaultArguments
=== PAUSE TestAccAWSGlueJob_DefaultArguments
=== RUN   TestAccAWSGlueJob_Description
=== PAUSE TestAccAWSGlueJob_Description
=== RUN   TestAccAWSGlueJob_ExecutionProperty
=== PAUSE TestAccAWSGlueJob_ExecutionProperty
=== RUN   TestAccAWSGlueJob_MaxRetries
=== PAUSE TestAccAWSGlueJob_MaxRetries
=== RUN   TestAccAWSGlueJob_Timeout
=== PAUSE TestAccAWSGlueJob_Timeout
=== RUN   TestAccAWSGlueJob_SecurityConfiguration
=== PAUSE TestAccAWSGlueJob_SecurityConfiguration
=== RUN   TestAccAWSGlueJob_PythonShell
=== PAUSE TestAccAWSGlueJob_PythonShell
=== RUN   TestAccAWSGlueJob_MaxCapacity
=== PAUSE TestAccAWSGlueJob_MaxCapacity
=== CONT  TestAccAWSGlueJob_Basic
=== CONT  TestAccAWSGlueJob_MaxRetries
=== CONT  TestAccAWSGlueJob_DefaultArguments
=== CONT  TestAccAWSGlueJob_ExecutionProperty
=== CONT  TestAccAWSGlueJob_Description
=== CONT  TestAccAWSGlueJob_Command
=== CONT  TestAccAWSGlueJob_AllocatedCapacity
=== CONT  TestAccAWSGlueJob_PythonShell
=== CONT  TestAccAWSGlueJob_MaxCapacity
=== CONT  TestAccAWSGlueJob_SecurityConfiguration
=== CONT  TestAccAWSGlueJob_Timeout
--- PASS: TestAccAWSGlueJob_PythonShell (65.13s)
--- PASS: TestAccAWSGlueJob_AllocatedCapacity (65.33s)
--- PASS: TestAccAWSGlueJob_Description (73.43s)
--- PASS: TestAccAWSGlueJob_MaxRetries (75.89s)
--- PASS: TestAccAWSGlueJob_MaxCapacity (80.21s)
--- PASS: TestAccAWSGlueJob_ExecutionProperty (83.05s)
--- PASS: TestAccAWSGlueJob_Basic (88.65s)
--- PASS: TestAccAWSGlueJob_Timeout (94.78s)
--- PASS: TestAccAWSGlueJob_DefaultArguments (104.18s)
--- PASS: TestAccAWSGlueJob_SecurityConfiguration (107.97s)
--- PASS: TestAccAWSGlueJob_Command (161.33s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	161.395s

@ghost ghost added size/L Managed by automation to categorize the size of a PR. service/glue Issues and PRs that pertain to the glue service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Jan 26, 2019
@ericandrewmeadows
Copy link

@kterada0509 - you're a rockstar!! Thanks for getting this done so quick - fingers-crossed it will make 0.12 :).

@himanshu-pro
Copy link

Why is this still open..?

@rcislo
Copy link

rcislo commented Mar 20, 2019

When will it be released?

@ejconlon
Copy link

ejconlon commented Apr 1, 2019

Ping (and thank you to the author and reviewers)! It's not possible to create pythonshell jobs without the max_capacity attribute.

@zentavr
Copy link

zentavr commented Apr 26, 2019

@bflad - I wonder if anyone from your team can review that?

@nywilken nywilken added this to the v2.10.0 milestone May 6, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

@kterada0509 my apologies for the long delay here, and thanks for pushing this change forward. The changes you proposed look good. I left a comment to add the ConflictsWith property for the old and new attributes, and I would also like to ask that you rebase your branch onto the latest master to fix a number of linting issues.

Cheers!

@@ -24,7 +24,8 @@ func resourceAwsGlueJob() *schema.Resource {
"allocated_capacity": {
Type: schema.TypeInt,
Optional: true,
Default: 10,
Computed: true,
Deprecated: "Please use attribute `max_capacity' instead. This attribute might be removed in future releases.",
Copy link
Contributor

Choose a reason for hiding this comment

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

When deprecating an attribute it is important to add ConflictsWith to the resource schema for both the old and new attributes. More information can be found on our deprecation guide at https://www.terraform.io/docs/extend/best-practices/deprecations.html#renaming-an-optional-attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nywilken
Fix to add ConflictsWith.

@teraken0509 teraken0509 force-pushed the feature/fix-deprecate-attribute-for-aws_glue_job branch from 0c47022 to 52c765c Compare May 7, 2019 04:45
@teraken0509
Copy link
Contributor Author

@nywilken
Thanks for review.
I rebased master & rerun the below test.

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSGlueJob_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSGlueJob_ -timeout 120m
=== RUN   TestAccAWSGlueJob_Basic
=== PAUSE TestAccAWSGlueJob_Basic
=== RUN   TestAccAWSGlueJob_AllocatedCapacity
=== PAUSE TestAccAWSGlueJob_AllocatedCapacity
=== RUN   TestAccAWSGlueJob_Command
=== PAUSE TestAccAWSGlueJob_Command
=== RUN   TestAccAWSGlueJob_DefaultArguments
=== PAUSE TestAccAWSGlueJob_DefaultArguments
=== RUN   TestAccAWSGlueJob_Description
=== PAUSE TestAccAWSGlueJob_Description
=== RUN   TestAccAWSGlueJob_ExecutionProperty
=== PAUSE TestAccAWSGlueJob_ExecutionProperty
=== RUN   TestAccAWSGlueJob_MaxRetries
=== PAUSE TestAccAWSGlueJob_MaxRetries
=== RUN   TestAccAWSGlueJob_Timeout
=== PAUSE TestAccAWSGlueJob_Timeout
=== RUN   TestAccAWSGlueJob_SecurityConfiguration
=== PAUSE TestAccAWSGlueJob_SecurityConfiguration
=== RUN   TestAccAWSGlueJob_PythonShell
=== PAUSE TestAccAWSGlueJob_PythonShell
=== RUN   TestAccAWSGlueJob_MaxCapacity
=== PAUSE TestAccAWSGlueJob_MaxCapacity
=== CONT  TestAccAWSGlueJob_Basic
=== CONT  TestAccAWSGlueJob_MaxRetries
=== CONT  TestAccAWSGlueJob_PythonShell
=== CONT  TestAccAWSGlueJob_Timeout
=== CONT  TestAccAWSGlueJob_SecurityConfiguration
=== CONT  TestAccAWSGlueJob_ExecutionProperty
=== CONT  TestAccAWSGlueJob_Description
=== CONT  TestAccAWSGlueJob_DefaultArguments
=== CONT  TestAccAWSGlueJob_MaxCapacity
=== CONT  TestAccAWSGlueJob_Command
=== CONT  TestAccAWSGlueJob_AllocatedCapacity
--- PASS: TestAccAWSGlueJob_PythonShell (63.91s)
--- PASS: TestAccAWSGlueJob_AllocatedCapacity (83.88s)
--- PASS: TestAccAWSGlueJob_Command (84.27s)
--- PASS: TestAccAWSGlueJob_MaxRetries (88.36s)
--- PASS: TestAccAWSGlueJob_MaxCapacity (92.48s)
--- PASS: TestAccAWSGlueJob_Description (93.83s)
--- PASS: TestAccAWSGlueJob_DefaultArguments (95.86s)
--- PASS: TestAccAWSGlueJob_SecurityConfiguration (99.02s)
--- PASS: TestAccAWSGlueJob_Timeout (115.07s)
--- PASS: TestAccAWSGlueJob_Basic (150.31s)
--- PASS: TestAccAWSGlueJob_ExecutionProperty (164.13s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	164.223s

Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

@kterada0509 thanks for the quick updates. This is good to go 👍

@nywilken nywilken merged commit 11c888d into hashicorp:master May 7, 2019
syncroswitch pushed a commit to syncroswitch/terraform-provider-aws that referenced this pull request May 7, 2019
* Fix aws_glue_job resource attribute

* Add ConflictsWith param for deprecated/new attribute
nywilken added a commit that referenced this pull request May 14, 2019
@ghost
Copy link

ghost commented Mar 30, 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 30, 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. service/glue Issues and PRs that pertain to the glue service. size/L 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.

Enable support for pythonshell in aws_glue_job
7 participants