Skip to content

feat(cloudformation): provision AWS::Batch::* resources + tfacc#1990

Merged
vieiralucas merged 2 commits into
mainfrom
wt-batch-6
Jun 27, 2026
Merged

feat(cloudformation): provision AWS::Batch::* resources + tfacc#1990
vieiralucas merged 2 commits into
mainfrom
wt-batch-6

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 27, 2026

Copy link
Copy Markdown
Member

Final batch of the AWS Batch service: CloudFormation provisioning + terraform-provider-aws acceptance coverage.

What

  • CFN provisioner for AWS::Batch::ComputeEnvironment, AWS::Batch::JobQueue, AWS::Batch::JobDefinition. Resources are written into the Batch control plane on stack create and removed on stack delete.
  • Restart-safe: registers a cfn_snapshot_hooks entry for batch, so CFN-provisioned resources survive a restart in persistent mode (the CloudFormation-provisioned resources are not persisted and vanish on restart (persistent mode) #1766 write-through lesson). Delete matches the stored record by its *Arn field so hyphenated names round-trip cleanly.
  • tfacc: new batch service + shard running TestAccBatch(ComputeEnvironment|JobQueue|JobDefinition)_basic, with AWS_ENDPOINT_URL_BATCH routing.
  • Tests: CFN e2e (stack creates CE/JQ/JD, delete removes them) + a restart-persistence e2e. Both green locally.
  • Docs page updated.

Verification

  • cargo build --bin fakecloud clean
  • cargo clippy -p fakecloud-cloudformation -p fakecloud-tfacc clean
  • e2e cfn_provisions_batch_resources + cfn_provisioned_batch_survives_restart pass

Summary by cubic

Adds CloudFormation support for AWS::Batch::ComputeEnvironment, AWS::Batch::JobQueue, and AWS::Batch::JobDefinition. Stacks create real Batch control-plane records that persist across restarts and are cleaned up on delete; TF acc tests now pass cleanly.

  • New Features

    • CFN provisioner writes to Batch state and registers a cfn_snapshot_hooks entry for batch (restart-safe).
    • Delete matches resources by *Arn so hyphenated names round-trip cleanly.
    • tfacc: new batch service/shard running TestAccBatch(ComputeEnvironment|JobQueue|JobDefinition)_basic with AWS_ENDPOINT_URL_BATCH.
    • E2E coverage for CFN create/delete and restart persistence; docs updated.
  • Bug Fixes

    • Compute environments now return ecsClusterArn on describe.
    • Job definitions default optional containerProperties lists (environment, mountPoints, resourceRequirements, secrets, ulimits, volumes) to empty arrays.

Written for commit ebc8dbf. Summary will update on new commits.

Review in cubic

Add a CloudFormation provisioner for AWS::Batch::ComputeEnvironment,
AWS::Batch::JobQueue, and AWS::Batch::JobDefinition. The provisioner
writes records directly into the batch service control plane and
registers a cfn_snapshot_hooks entry so the resources survive a restart
in persistent mode (the #1766 write-through lesson). Delete matches the
stored record by its *Arn field so hyphenated names round-trip.

Wire the terraform-provider-aws Batch acceptance suite
(TestAccBatch{ComputeEnvironment,JobQueue,JobDefinition}_basic) as a new
tfacc service + shard, with AWS_ENDPOINT_URL_BATCH routing.

Add CFN e2e (stack creates CE/JQ/JD, delete removes them) + a
restart-persistence e2e, and update the Batch docs page.
…rrays on JD

The terraform-provider-aws Batch acceptance suite reads these back:
- DescribeComputeEnvironments now reports ecsClusterArn (every managed/
  unmanaged CE is backed by an ECS cluster; the provider asserts it set).
- RegisterJobDefinition defaults the optional containerProperties list
  members (environment/mountPoints/resourceRequirements/secrets/ulimits/
  volumes) to empty arrays, matching what AWS echoes on describe, so the
  provider's container_properties round-trips exactly.
@vieiralucas vieiralucas merged commit 775a215 into main Jun 27, 2026
104 checks passed
@vieiralucas vieiralucas deleted the wt-batch-6 branch June 27, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant