-
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
r/aws_batch_job_queue - new attribute #22298
r/aws_batch_job_queue - new attribute #22298
Conversation
create job queue with scheduling_policy_arn and update the arn
if scheduling_policy_arn is set for FIFO queue, error is "Only fairshare queue can have scheduling policy"
Running through all tests:
|
pass terrafmt and the test case
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 🚀.
% make testacc TESTS=TestAccBatch PKG=batch ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/batch/... -v -count 1 -parallel 2 -run='TestAccBatch' -timeout 180m
=== RUN TestAccBatchComputeEnvironmentDataSource_basic
=== PAUSE TestAccBatchComputeEnvironmentDataSource_basic
=== RUN TestAccBatchComputeEnvironment_basic
=== PAUSE TestAccBatchComputeEnvironment_basic
=== RUN TestAccBatchComputeEnvironment_disappears
=== PAUSE TestAccBatchComputeEnvironment_disappears
=== RUN TestAccBatchComputeEnvironment_nameGenerated
=== PAUSE TestAccBatchComputeEnvironment_nameGenerated
=== RUN TestAccBatchComputeEnvironment_namePrefix
=== PAUSE TestAccBatchComputeEnvironment_namePrefix
=== RUN TestAccBatchComputeEnvironment_createEC2
=== PAUSE TestAccBatchComputeEnvironment_createEC2
=== RUN TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== PAUSE TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== RUN TestAccBatchComputeEnvironment_createSpot
=== PAUSE TestAccBatchComputeEnvironment_createSpot
=== RUN TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
=== PAUSE TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
=== RUN TestAccBatchComputeEnvironment_createFargate
=== PAUSE TestAccBatchComputeEnvironment_createFargate
=== RUN TestAccBatchComputeEnvironment_createFargateSpot
=== PAUSE TestAccBatchComputeEnvironment_createFargateSpot
=== RUN TestAccBatchComputeEnvironment_updateState
=== PAUSE TestAccBatchComputeEnvironment_updateState
=== RUN TestAccBatchComputeEnvironment_updateServiceRole
=== PAUSE TestAccBatchComputeEnvironment_updateServiceRole
=== RUN TestAccBatchComputeEnvironment_defaultServiceRole
=== PAUSE TestAccBatchComputeEnvironment_defaultServiceRole
=== RUN TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
=== PAUSE TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
=== RUN TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== PAUSE TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== RUN TestAccBatchComputeEnvironment_ec2Configuration
=== PAUSE TestAccBatchComputeEnvironment_ec2Configuration
=== RUN TestAccBatchComputeEnvironment_launchTemplate
=== PAUSE TestAccBatchComputeEnvironment_launchTemplate
=== RUN TestAccBatchComputeEnvironment_updateLaunchTemplate
=== PAUSE TestAccBatchComputeEnvironment_updateLaunchTemplate
=== RUN TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
=== PAUSE TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
=== RUN TestAccBatchComputeEnvironment_tags
=== PAUSE TestAccBatchComputeEnvironment_tags
=== RUN TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
=== PAUSE TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
=== RUN TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== PAUSE TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== RUN TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
=== PAUSE TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
=== RUN TestAccBatchJobDefinition_basic
=== PAUSE TestAccBatchJobDefinition_basic
=== RUN TestAccBatchJobDefinition_disappears
=== PAUSE TestAccBatchJobDefinition_disappears
=== RUN TestAccBatchJobDefinition_PlatformCapabilities_ec2
=== PAUSE TestAccBatchJobDefinition_PlatformCapabilities_ec2
=== RUN TestAccBatchJobDefinition_PlatformCapabilitiesFargate_containerPropertiesDefaults
=== PAUSE TestAccBatchJobDefinition_PlatformCapabilitiesFargate_containerPropertiesDefaults
=== RUN TestAccBatchJobDefinition_PlatformCapabilities_fargate
=== PAUSE TestAccBatchJobDefinition_PlatformCapabilities_fargate
=== RUN TestAccBatchJobDefinition_ContainerProperties_advanced
=== PAUSE TestAccBatchJobDefinition_ContainerProperties_advanced
=== RUN TestAccBatchJobDefinition_updateForcesNewResource
=== PAUSE TestAccBatchJobDefinition_updateForcesNewResource
=== RUN TestAccBatchJobDefinition_tags
=== PAUSE TestAccBatchJobDefinition_tags
=== RUN TestAccBatchJobDefinition_propagateTags
=== PAUSE TestAccBatchJobDefinition_propagateTags
=== RUN TestAccBatchJobQueueDataSource_basic
=== PAUSE TestAccBatchJobQueueDataSource_basic
=== RUN TestAccBatchJobQueue_basic
=== PAUSE TestAccBatchJobQueue_basic
=== RUN TestAccBatchJobQueue_disappears
=== PAUSE TestAccBatchJobQueue_disappears
=== RUN TestAccBatchJobQueue_ComputeEnvironments_externalOrderUpdate
=== PAUSE TestAccBatchJobQueue_ComputeEnvironments_externalOrderUpdate
=== RUN TestAccBatchJobQueue_priority
=== PAUSE TestAccBatchJobQueue_priority
=== RUN TestAccBatchJobQueue_schedulingPolicy
=== PAUSE TestAccBatchJobQueue_schedulingPolicy
=== RUN TestAccBatchJobQueue_state
=== PAUSE TestAccBatchJobQueue_state
=== RUN TestAccBatchJobQueue_tags
=== PAUSE TestAccBatchJobQueue_tags
=== RUN TestAccBatchSchedulingPolicy_basic
=== PAUSE TestAccBatchSchedulingPolicy_basic
=== RUN TestAccBatchSchedulingPolicy_disappears
=== PAUSE TestAccBatchSchedulingPolicy_disappears
=== CONT TestAccBatchComputeEnvironmentDataSource_basic
=== CONT TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
--- PASS: TestAccBatchComputeEnvironment_createEC2WithoutComputeResources (17.13s)
=== CONT TestAccBatchJobQueueDataSource_basic
--- PASS: TestAccBatchComputeEnvironmentDataSource_basic (56.38s)
=== CONT TestAccBatchJobDefinition_propagateTags
--- PASS: TestAccBatchJobDefinition_propagateTags (12.35s)
=== CONT TestAccBatchSchedulingPolicy_disappears
--- PASS: TestAccBatchSchedulingPolicy_disappears (11.58s)
=== CONT TestAccBatchJobDefinition_tags
--- PASS: TestAccBatchJobDefinition_tags (38.96s)
=== CONT TestAccBatchSchedulingPolicy_basic
--- PASS: TestAccBatchJobQueueDataSource_basic (108.21s)
=== CONT TestAccBatchJobDefinition_updateForcesNewResource
--- PASS: TestAccBatchSchedulingPolicy_basic (39.09s)
=== CONT TestAccBatchJobQueue_tags
--- PASS: TestAccBatchJobDefinition_updateForcesNewResource (39.15s)
=== CONT TestAccBatchJobDefinition_ContainerProperties_advanced
--- PASS: TestAccBatchJobDefinition_ContainerProperties_advanced (20.21s)
=== CONT TestAccBatchJobDefinition_PlatformCapabilities_fargate
--- PASS: TestAccBatchJobDefinition_PlatformCapabilities_fargate (23.33s)
=== CONT TestAccBatchJobDefinition_PlatformCapabilitiesFargate_containerPropertiesDefaults
--- PASS: TestAccBatchJobDefinition_PlatformCapabilitiesFargate_containerPropertiesDefaults (31.92s)
=== CONT TestAccBatchJobDefinition_PlatformCapabilities_ec2
--- PASS: TestAccBatchJobDefinition_PlatformCapabilities_ec2 (17.07s)
=== CONT TestAccBatchJobDefinition_disappears
--- PASS: TestAccBatchJobDefinition_disappears (11.76s)
=== CONT TestAccBatchJobDefinition_basic
--- PASS: TestAccBatchJobDefinition_basic (16.99s)
=== CONT TestAccBatchJobQueue_state
--- PASS: TestAccBatchJobQueue_tags (207.67s)
=== CONT TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
--- PASS: TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole (15.43s)
=== CONT TestAccBatchJobQueue_schedulingPolicy
--- PASS: TestAccBatchJobQueue_state (182.13s)
=== CONT TestAccBatchJobQueue_priority
--- PASS: TestAccBatchJobQueue_schedulingPolicy (141.62s)
=== CONT TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
--- PASS: TestAccBatchJobQueue_priority (159.07s)
=== CONT TestAccBatchComputeEnvironment_createFargateSpot
--- PASS: TestAccBatchComputeEnvironment_createFargateSpot (35.82s)
=== CONT TestAccBatchComputeEnvironment_updateState
--- PASS: TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags (140.99s)
=== CONT TestAccBatchComputeEnvironment_createFargate
--- PASS: TestAccBatchComputeEnvironment_createFargate (36.26s)
=== CONT TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
--- PASS: TestAccBatchComputeEnvironment_updateState (65.68s)
=== CONT TestAccBatchJobQueue_ComputeEnvironments_externalOrderUpdate
--- PASS: TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage (37.74s)
=== CONT TestAccBatchComputeEnvironment_createSpot
--- PASS: TestAccBatchJobQueue_ComputeEnvironments_externalOrderUpdate (119.44s)
=== CONT TestAccBatchJobQueue_disappears
--- PASS: TestAccBatchJobQueue_disappears (173.14s)
=== CONT TestAccBatchJobQueue_basic
--- PASS: TestAccBatchJobQueue_basic (106.33s)
=== CONT TestAccBatchComputeEnvironment_ec2Configuration
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (96.19s)
=== CONT TestAccBatchComputeEnvironment_tags
--- PASS: TestAccBatchComputeEnvironment_createSpot (527.89s)
=== CONT TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
--- PASS: TestAccBatchComputeEnvironment_tags (120.34s)
=== CONT TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
--- PASS: TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate (64.57s)
=== CONT TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
--- PASS: TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources (36.64s)
=== CONT TestAccBatchComputeEnvironment_updateLaunchTemplate
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_minVCPUs (228.20s)
=== CONT TestAccBatchComputeEnvironment_defaultServiceRole
acctest.go:749: skipping tests; missing IAM service-linked role /aws-service-role/batch. Please create the role and retry
--- SKIP: TestAccBatchComputeEnvironment_defaultServiceRole (0.49s)
=== CONT TestAccBatchComputeEnvironment_launchTemplate
--- PASS: TestAccBatchComputeEnvironment_updateLaunchTemplate (62.38s)
=== CONT TestAccBatchComputeEnvironment_updateServiceRole
--- PASS: TestAccBatchComputeEnvironment_launchTemplate (36.84s)
=== CONT TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
--- PASS: TestAccBatchComputeEnvironment_updateServiceRole (84.18s)
=== CONT TestAccBatchComputeEnvironment_createEC2
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs (76.23s)
=== CONT TestAccBatchComputeEnvironment_namePrefix
--- PASS: TestAccBatchComputeEnvironment_createEC2 (43.54s)
=== CONT TestAccBatchComputeEnvironment_basic
--- PASS: TestAccBatchComputeEnvironment_namePrefix (49.50s)
=== CONT TestAccBatchComputeEnvironment_disappears
--- PASS: TestAccBatchComputeEnvironment_disappears (40.69s)
=== CONT TestAccBatchComputeEnvironment_nameGenerated
--- PASS: TestAccBatchComputeEnvironment_basic (65.26s)
--- PASS: TestAccBatchComputeEnvironment_nameGenerated (66.22s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/batch 1767.707s
@GlennChia Thanks for the contribution 🎉 👏. |
This functionality has been released in v3.71.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. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Closes #21755
Output from acceptance testing:
Changes made
aws_batch_scheduling_policy
resource from r/aws_batch_scheduling_policy #22262aws_batch_scheduling_policy
that was missed in the earlier PRscheduling_policy_arn
toaws_batch_job_queue
scheduling_policy_arn
and then updating the ARN to an ARN of anotheraws_batch_scheduling_policy
resourceNotes
HasChanges
to check ifscheduling_policy_arn
has changed and whether that change was a removal or an actual update. If it was a removal, throw an error. If it was an update, proceed.scheduling_policy_arn
), SchedulingPolicyArn should not be set. Error is "Only fairshare queue can have scheduling policy" if we set this value after the creation of the queue. A conditional check was used to fix this error.