Skip to content

Commit 147c360

Browse files
committed
fix(ci-lease): use per-account S3 staging bucket for CFN deploy
CFN requires templates >51KB to be uploaded to S3 first. Several scenarios (council-chatbot, simply-readable, ai-contact-centre) exceed this. Council-chatbot dispatch just hit: Templates with a size greater than 51,200 bytes must be deployed via an S3 Bucket. Please add the --s3-bucket parameter Create a per-account staging bucket on demand (ndx-try-ci-cfn-stage-{acct}) because the leased pool account is wiped between leases. mb is idempotent on existing buckets; SSE-AES256 added because S3 default since 2023.
1 parent dc66cb8 commit 147c360

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/scenario-ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,29 @@ jobs:
117117
env:
118118
SCENARIO: ${{ inputs.scenario }}
119119
TEMPLATE: ${{ steps.paths.outputs.template_path }}
120+
ACCOUNT_ID: ${{ steps.lease.outputs.account_id }}
120121
run: |
121122
set -euo pipefail
122123
STACK_NAME="ndx-try-${SCENARIO}"
124+
# CFN requires templates >51KB to be staged in S3. Several
125+
# scenarios (council-chatbot, simply-readable, ai-contact-centre)
126+
# exceed this. Create a per-account staging bucket on demand —
127+
# the leased pool account is wiped between leases so we can't
128+
# rely on a pre-existing bucket. mb is idempotent on existing
129+
# buckets and the bucket is freshly created each lease cycle.
130+
BUCKET="ndx-try-ci-cfn-stage-${ACCOUNT_ID}"
131+
aws s3api create-bucket \
132+
--bucket "$BUCKET" \
133+
--region us-east-1 \
134+
>/dev/null 2>&1 || true
135+
aws s3api put-bucket-encryption \
136+
--bucket "$BUCKET" \
137+
--server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}' \
138+
>/dev/null 2>&1 || true
123139
aws cloudformation deploy \
124140
--stack-name "$STACK_NAME" \
125141
--template-file "$TEMPLATE" \
142+
--s3-bucket "$BUCKET" \
126143
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
127144
--no-fail-on-empty-changeset \
128145
--tags Project=ndx-try Scenario="$SCENARIO" RunId="${{ github.run_id }}"

0 commit comments

Comments
 (0)