-
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
Add platform capability to Batch job definition #16850
Add platform capability to Batch job definition #16850
Conversation
b20dddd
to
52c1c15
Compare
52c1c15
to
533ea28
Compare
@@ -61,6 +130,7 @@ The following arguments are supported: | |||
* `container_properties` - (Optional) A valid [container properties](http://docs.aws.amazon.com/batch/latest/APIReference/API_RegisterJobDefinition.html) | |||
provided as a single valid JSON document. This parameter is required if the `type` parameter is `container`. | |||
* `parameters` - (Optional) Specifies the parameter substitution placeholders to set in the job definition. | |||
* `platform_capability` - (Optional) The platform capabilities required by the job definition. If no value is specified, it defaults to `EC2`. Jobs run on Fargate resources specify `FARGATE`. |
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.
according the the basic test check there is no value if one is not specified:
resource.TestCheckResourceAttr(resourceName, "platform_capability.#", "0"),
how does this conform with the above docs?
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's maybe unclear but the platformCapabilities
is optional and if not specified defaults to EC2
, that means job will be only able to run on an EC2 compute environment. This idea of the test check is to be sure that this do not introduce a new behaviour and modify existing job definitions.
See AWS documentation: https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html#job-definition-parameters-platform-capabilities
Awesome! Looking forward too this |
Anything left to do to see this make its way into the next release? We're really looking forward to it. Happy to lend a hand if there is outstanding blockers. |
any news on this? |
…_capabilities'. Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobDefinition_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBatchJobDefinition_ -timeout 180m === RUN TestAccAWSBatchJobDefinition_basic === PAUSE TestAccAWSBatchJobDefinition_basic === RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 === PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 === RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate === PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate === RUN TestAccAWSBatchJobDefinition_ContainerProperties_Advanced === PAUSE TestAccAWSBatchJobDefinition_ContainerProperties_Advanced === RUN TestAccAWSBatchJobDefinition_updateForcesNewResource === PAUSE TestAccAWSBatchJobDefinition_updateForcesNewResource === RUN TestAccAWSBatchJobDefinition_Tags === PAUSE TestAccAWSBatchJobDefinition_Tags === CONT TestAccAWSBatchJobDefinition_basic === CONT TestAccAWSBatchJobDefinition_Tags === CONT TestAccAWSBatchJobDefinition_updateForcesNewResource === CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate === CONT TestAccAWSBatchJobDefinition_ContainerProperties_Advanced === CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 --- PASS: TestAccAWSBatchJobDefinition_basic (15.37s) --- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 (15.44s) --- PASS: TestAccAWSBatchJobDefinition_ContainerProperties_Advanced (19.44s) --- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate (19.81s) --- PASS: TestAccAWSBatchJobDefinition_updateForcesNewResource (24.59s) --- PASS: TestAccAWSBatchJobDefinition_Tags (30.90s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 33.926s
60fb3aa
to
5a65b23
Compare
Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobDefinition_disappears' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBatchJobDefinition_disappears -timeout 180m === RUN TestAccAWSBatchJobDefinition_disappears === PAUSE TestAccAWSBatchJobDefinition_disappears === CONT TestAccAWSBatchJobDefinition_disappears --- PASS: TestAccAWSBatchJobDefinition_disappears (9.67s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 14.046s
Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobDefinition_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBatchJobDefinition_basic -timeout 180m === RUN TestAccAWSBatchJobDefinition_basic === PAUSE TestAccAWSBatchJobDefinition_basic === CONT TestAccAWSBatchJobDefinition_basic --- PASS: TestAccAWSBatchJobDefinition_basic (12.62s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 15.829s
Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobDefinition_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBatchJobDefinition_ -timeout 180m === RUN TestAccAWSBatchJobDefinition_basic === PAUSE TestAccAWSBatchJobDefinition_basic === RUN TestAccAWSBatchJobDefinition_disappears === PAUSE TestAccAWSBatchJobDefinition_disappears === RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 === PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 === RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate === PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate === RUN TestAccAWSBatchJobDefinition_ContainerProperties_Advanced === PAUSE TestAccAWSBatchJobDefinition_ContainerProperties_Advanced === RUN TestAccAWSBatchJobDefinition_updateForcesNewResource === PAUSE TestAccAWSBatchJobDefinition_updateForcesNewResource === RUN TestAccAWSBatchJobDefinition_Tags === PAUSE TestAccAWSBatchJobDefinition_Tags === CONT TestAccAWSBatchJobDefinition_basic === CONT TestAccAWSBatchJobDefinition_ContainerProperties_Advanced === CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 === CONT TestAccAWSBatchJobDefinition_disappears === CONT TestAccAWSBatchJobDefinition_Tags === CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate === CONT TestAccAWSBatchJobDefinition_updateForcesNewResource --- PASS: TestAccAWSBatchJobDefinition_disappears (13.05s) --- PASS: TestAccAWSBatchJobDefinition_ContainerProperties_Advanced (15.72s) --- PASS: TestAccAWSBatchJobDefinition_basic (15.84s) --- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 (16.82s) --- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate (18.69s) --- PASS: TestAccAWSBatchJobDefinition_updateForcesNewResource (25.88s) --- PASS: TestAccAWSBatchJobDefinition_Tags (31.97s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 35.037s
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.
LGTM.
Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobDefinition_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBatchJobDefinition_ -timeout 180m
=== RUN TestAccAWSBatchJobDefinition_basic
=== PAUSE TestAccAWSBatchJobDefinition_basic
=== RUN TestAccAWSBatchJobDefinition_disappears
=== PAUSE TestAccAWSBatchJobDefinition_disappears
=== RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2
=== PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2
=== RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate
=== PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate
=== RUN TestAccAWSBatchJobDefinition_ContainerProperties_Advanced
=== PAUSE TestAccAWSBatchJobDefinition_ContainerProperties_Advanced
=== RUN TestAccAWSBatchJobDefinition_updateForcesNewResource
=== PAUSE TestAccAWSBatchJobDefinition_updateForcesNewResource
=== RUN TestAccAWSBatchJobDefinition_Tags
=== PAUSE TestAccAWSBatchJobDefinition_Tags
=== CONT TestAccAWSBatchJobDefinition_basic
=== CONT TestAccAWSBatchJobDefinition_ContainerProperties_Advanced
=== CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2
=== CONT TestAccAWSBatchJobDefinition_disappears
=== CONT TestAccAWSBatchJobDefinition_Tags
=== CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate
=== CONT TestAccAWSBatchJobDefinition_updateForcesNewResource
--- PASS: TestAccAWSBatchJobDefinition_disappears (13.05s)
--- PASS: TestAccAWSBatchJobDefinition_ContainerProperties_Advanced (15.72s)
--- PASS: TestAccAWSBatchJobDefinition_basic (15.84s)
--- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 (16.82s)
--- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate (18.69s)
--- PASS: TestAccAWSBatchJobDefinition_updateForcesNewResource (25.88s)
--- PASS: TestAccAWSBatchJobDefinition_Tags (31.97s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 35.037s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobDefinition_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBatchJobDefinition_ -timeout 180m
=== RUN TestAccAWSBatchJobDefinition_basic
=== PAUSE TestAccAWSBatchJobDefinition_basic
=== RUN TestAccAWSBatchJobDefinition_disappears
=== PAUSE TestAccAWSBatchJobDefinition_disappears
=== RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2
=== PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2
=== RUN TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate
=== PAUSE TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate
=== RUN TestAccAWSBatchJobDefinition_ContainerProperties_Advanced
=== PAUSE TestAccAWSBatchJobDefinition_ContainerProperties_Advanced
=== RUN TestAccAWSBatchJobDefinition_updateForcesNewResource
=== PAUSE TestAccAWSBatchJobDefinition_updateForcesNewResource
=== RUN TestAccAWSBatchJobDefinition_Tags
=== PAUSE TestAccAWSBatchJobDefinition_Tags
=== CONT TestAccAWSBatchJobDefinition_basic
=== CONT TestAccAWSBatchJobDefinition_ContainerProperties_Advanced
=== CONT TestAccAWSBatchJobDefinition_Tags
=== CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2
=== CONT TestAccAWSBatchJobDefinition_disappears
=== CONT TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate
=== CONT TestAccAWSBatchJobDefinition_updateForcesNewResource
--- PASS: TestAccAWSBatchJobDefinition_disappears (19.36s)
--- PASS: TestAccAWSBatchJobDefinition_basic (19.73s)
--- PASS: TestAccAWSBatchJobDefinition_ContainerProperties_Advanced (19.86s)
--- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_Fargate (23.62s)
--- PASS: TestAccAWSBatchJobDefinition_PlatformCapabilities_EC2 (23.80s)
--- PASS: TestAccAWSBatchJobDefinition_updateForcesNewResource (36.87s)
--- PASS: TestAccAWSBatchJobDefinition_Tags (47.88s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 50.807s
@gmazelier Thanks for the contribution 👏. |
@ewbankkit, excellent, thank you! |
This has been released in version 3.38.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! |
Community Note
Relates #16592
Release note for CHANGELOG:
Output from acceptance testing: