From 0d3944b0ddea59f6e2a4762a8b2c3f62a8155bd5 Mon Sep 17 00:00:00 2001 From: Tom Arne Date: Thu, 2 Jul 2026 15:18:22 +0200 Subject: [PATCH 01/10] Add optional subnet and security group IDs inputs for ECS Express deployment --- .../preview/deploy-ecs-express-service/action.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index d784eca..27c790f 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -33,6 +33,14 @@ inputs: description: 'Custom environment variables as JSON object, e.g. {"NAME":"VALUE"}' required: false default: '{}' + subnet-ids: + description: "JSON array of subnet IDs for the service, e.g. '["subnet-abc"]'." + required: false + default: '' + security-group-ids: + description: "JSON array of security group IDs for the service, e.g. '["sg-abc"]'. Only used when subnet-ids is also set." + required: false + default: '' outputs: service-url: @@ -170,6 +178,12 @@ runs: infrastructureRoleArn="${{ steps.set-service-variables.outputs.infrastructure_role_arn }}" taskRoleArn="${{ steps.set-service-variables.outputs.task_tole_arn }}" echo "Deploying Preview: ${{ steps.set-service-variables.outputs.service_name }} ($executionRoleArn, $infrastructureRoleArn, $taskRoleArn)..." + + NETWORK_ARGS=() + if [ -n '${{ inputs.subnet-ids }}' ]; then + SECURITY_GROUPS='${{ inputs.security-group-ids }}' + NETWORK_ARGS=(--network-configuration "{\"subnets\":${{ inputs.subnet-ids }},\"securityGroups\":${SECURITY_GROUPS:-[]}}") + fi aws ecs create-express-gateway-service \ --service-name "${{ steps.set-service-variables.outputs.service_name }}" \ @@ -179,6 +193,7 @@ runs: --primary-container "$primary_container" \ --health-check-path "$HEALTH_CHECK_ENDPOINT" \ --scaling-target '{"minTaskCount": 1, "maxTaskCount": 1}' \ + "${NETWORK_ARGS[@]}" \ --region "${{ inputs.aws-region }}" serviceArn="arn:aws:ecs:${{ inputs.aws-region }}:${{ inputs.aws-account-id }}:service/default/${{ steps.set-service-variables.outputs.service_name }}" From 2371f2aa73cc84519bc61763be9cda5bc79ae4e7 Mon Sep 17 00:00:00 2001 From: Tom Arne Date: Fri, 3 Jul 2026 11:45:01 +0200 Subject: [PATCH 02/10] Enhance ECS Express deployment with subnet and security group ID validation --- .../deploy-ecs-express-service/action.yml | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index 27c790f..e7e67ee 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -34,11 +34,11 @@ inputs: required: false default: '{}' subnet-ids: - description: "JSON array of subnet IDs for the service, e.g. '["subnet-abc"]'." + description: 'JSON array of subnet IDs for the service, e.g. ["subnet-abc"].' required: false default: '' security-group-ids: - description: "JSON array of security group IDs for the service, e.g. '["sg-abc"]'. Only used when subnet-ids is also set." + description: 'JSON array of security group IDs for the service, e.g. ["sg-abc"]. Required when subnet-ids is set and the subnets belong to a shared VPC.' required: false default: '' @@ -153,6 +153,8 @@ runs: ENV_VARS_CONFIG: ${{ steps.prepare-env-vars.outputs.env_vars_config }} PLAINTEXT_ENV_VARS: ${{ steps.prepare-env-vars.outputs.plaintext_env_vars }} HEALTH_CHECK_ENDPOINT: ${{ inputs.health-endpoint }} + SUBNET_IDS: ${{ inputs.subnet-ids }} + SECURITY_GROUP_IDS: ${{ inputs.security-group-ids }} run: | secrets="$(jq -c '[to_entries[] | {name: .key, valueFrom: .value}]' <<< "$ENV_VARS_CONFIG")" plaintext="$(jq -c '[to_entries[] | {name: .key, value: .value}]' <<< "$PLAINTEXT_ENV_VARS")" @@ -180,9 +182,13 @@ runs: echo "Deploying Preview: ${{ steps.set-service-variables.outputs.service_name }} ($executionRoleArn, $infrastructureRoleArn, $taskRoleArn)..." NETWORK_ARGS=() - if [ -n '${{ inputs.subnet-ids }}' ]; then - SECURITY_GROUPS='${{ inputs.security-group-ids }}' - NETWORK_ARGS=(--network-configuration "{\"subnets\":${{ inputs.subnet-ids }},\"securityGroups\":${SECURITY_GROUPS:-[]}}") + if [ -n "$SUBNET_IDS" ]; then + if [ -z "$SECURITY_GROUP_IDS" ]; then + echo "Error: security-group-ids must be set when subnet-ids are provided (required for shared VPC subnets)." + exit 1 + fi + NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') + NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi aws ecs create-express-gateway-service \ @@ -208,6 +214,8 @@ runs: ENV_VARS_CONFIG: ${{ steps.prepare-env-vars.outputs.env_vars_config }} PLAINTEXT_ENV_VARS: ${{ steps.prepare-env-vars.outputs.plaintext_env_vars }} HEALTH_CHECK_ENDPOINT: ${{ inputs.health-endpoint }} + SUBNET_IDS: ${{ inputs.subnet-ids }} + SECURITY_GROUP_IDS: ${{ inputs.security-group-ids }} run: | secrets="$(jq -c '[to_entries[] | {name: .key, valueFrom: .value}]' <<< "$ENV_VARS_CONFIG")" plaintext="$(jq -c '[to_entries[] | {name: .key, value: .value}]' <<< "$PLAINTEXT_ENV_VARS")" @@ -229,6 +237,16 @@ runs: SERVICE_ARN="${{ steps.check-service.outputs.service_arn }}" echo "Updating Preview: ${{ steps.set-service-variables.outputs.service_name }} ($SERVICE_ARN)..." + NETWORK_ARGS=() + if [ -n "$SUBNET_IDS" ]; then + if [ -z "$SECURITY_GROUP_IDS" ]; then + echo "Error: security-group-ids must be set when subnet-ids are provided (required for shared VPC subnets)." + exit 1 + fi + NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') + NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") + fi + aws ecs update-express-gateway-service \ --service-arn "$SERVICE_ARN" \ --execution-role-arn "$executionRoleArn" \ @@ -236,6 +254,7 @@ runs: --primary-container "$primary_container" \ --health-check-path "$HEALTH_CHECK_ENDPOINT" \ --scaling-target '{"minTaskCount": 1, "maxTaskCount": 1}' \ + "${NETWORK_ARGS[@]}" \ --region "${{ inputs.aws-region }}" echo "Update started! $SERVICE_ARN" From cde66548f66ef833c4276904567560a20325b6fd Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:04:10 +0200 Subject: [PATCH 03/10] Update sg description to be consistent with validation Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../deployment/preview/deploy-ecs-express-service/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index e7e67ee..1f2a0a1 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -38,7 +38,7 @@ inputs: required: false default: '' security-group-ids: - description: 'JSON array of security group IDs for the service, e.g. ["sg-abc"]. Required when subnet-ids is set and the subnets belong to a shared VPC.' + description: 'JSON array of security group IDs for the service, e.g. ["sg-abc"]. Required when subnet-ids is set.' required: false default: '' From dd6f347463bf94c29bbfc4a307e267a8a5d883cb Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:07:25 +0200 Subject: [PATCH 04/10] validating both inputs and emitting a clearer error message to help callers diagnose misformatted values Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../deployment/preview/deploy-ecs-express-service/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index 1f2a0a1..cce9867 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -183,10 +183,12 @@ runs: NETWORK_ARGS=() if [ -n "$SUBNET_IDS" ]; then + jq -e 'type == "array"' >/dev/null <<<"$SUBNET_IDS" || { echo "Error: subnet-ids must be a JSON array, e.g. [\"subnet-abc\"]"; exit 1; } if [ -z "$SECURITY_GROUP_IDS" ]; then - echo "Error: security-group-ids must be set when subnet-ids are provided (required for shared VPC subnets)." + echo "Error: security-group-ids must be set when subnet-ids are provided." exit 1 fi + jq -e 'type == "array"' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo "Error: security-group-ids must be a JSON array, e.g. [\"sg-abc\"]"; exit 1; } NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi From 7a022009bbd15fae525f4e5a7308cba58740aa31 Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:08:43 +0200 Subject: [PATCH 05/10] validating both inputs and emitting a clearer error message Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../deployment/preview/deploy-ecs-express-service/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index cce9867..eb28263 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -241,10 +241,12 @@ runs: NETWORK_ARGS=() if [ -n "$SUBNET_IDS" ]; then + jq -e 'type == "array"' >/dev/null <<<"$SUBNET_IDS" || { echo "Error: subnet-ids must be a JSON array, e.g. [\"subnet-abc\"]"; exit 1; } if [ -z "$SECURITY_GROUP_IDS" ]; then - echo "Error: security-group-ids must be set when subnet-ids are provided (required for shared VPC subnets)." + echo "Error: security-group-ids must be set when subnet-ids are provided." exit 1 fi + jq -e 'type == "array"' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo "Error: security-group-ids must be a JSON array, e.g. [\"sg-abc\"]"; exit 1; } NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi From 856ae9ba2f11104d591ac225acb6162437075eb0 Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:36:40 +0200 Subject: [PATCH 06/10] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../deploy-ecs-express-service/action.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index eb28263..5982112 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -182,13 +182,17 @@ runs: echo "Deploying Preview: ${{ steps.set-service-variables.outputs.service_name }} ($executionRoleArn, $infrastructureRoleArn, $taskRoleArn)..." NETWORK_ARGS=() + if [ -n "$SECURITY_GROUP_IDS" ] && [ -z "$SUBNET_IDS" ]; then + echo "Error: subnet-ids must be set when security-group-ids are provided." + exit 1 + fi if [ -n "$SUBNET_IDS" ]; then - jq -e 'type == "array"' >/dev/null <<<"$SUBNET_IDS" || { echo "Error: subnet-ids must be a JSON array, e.g. [\"subnet-abc\"]"; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SUBNET_IDS" || { echo 'Error: subnet-ids must be a non-empty JSON array of strings, e.g. ["subnet-abc"]'; exit 1; } if [ -z "$SECURITY_GROUP_IDS" ]; then echo "Error: security-group-ids must be set when subnet-ids are provided." exit 1 fi - jq -e 'type == "array"' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo "Error: security-group-ids must be a JSON array, e.g. [\"sg-abc\"]"; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi @@ -240,13 +244,17 @@ runs: echo "Updating Preview: ${{ steps.set-service-variables.outputs.service_name }} ($SERVICE_ARN)..." NETWORK_ARGS=() + if [ -n "$SECURITY_GROUP_IDS" ] && [ -z "$SUBNET_IDS" ]; then + echo "Error: subnet-ids must be set when security-group-ids are provided." + exit 1 + fi if [ -n "$SUBNET_IDS" ]; then - jq -e 'type == "array"' >/dev/null <<<"$SUBNET_IDS" || { echo "Error: subnet-ids must be a JSON array, e.g. [\"subnet-abc\"]"; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SUBNET_IDS" || { echo 'Error: subnet-ids must be a non-empty JSON array of strings, e.g. ["subnet-abc"]'; exit 1; } if [ -z "$SECURITY_GROUP_IDS" ]; then echo "Error: security-group-ids must be set when subnet-ids are provided." exit 1 fi - jq -e 'type == "array"' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo "Error: security-group-ids must be a JSON array, e.g. [\"sg-abc\"]"; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi From 8f674a5fa3ccbf9c1522dafe1835c69461ff3186 Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:58:47 +0200 Subject: [PATCH 07/10] Apply suggestions from code review: compact JSON Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../deployment/preview/deploy-ecs-express-service/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index 5982112..3cc42f7 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -193,7 +193,7 @@ runs: exit 1 fi jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } - NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') + NETWORK_CONFIG=$(jq -cn --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi @@ -255,7 +255,7 @@ runs: exit 1 fi jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } - NETWORK_CONFIG=$(jq -n --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') + NETWORK_CONFIG=$(jq -cn --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi From 8e5d747e508f0b92e3779f477c0e9a734472fb93 Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:06:34 +0200 Subject: [PATCH 08/10] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../preview/deploy-ecs-express-service/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index 3cc42f7..49105ed 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -187,12 +187,12 @@ runs: exit 1 fi if [ -n "$SUBNET_IDS" ]; then - jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SUBNET_IDS" || { echo 'Error: subnet-ids must be a non-empty JSON array of strings, e.g. ["subnet-abc"]'; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null 2>&1 <<<"$SUBNET_IDS" || { echo 'Error: subnet-ids must be a non-empty JSON array of strings, e.g. ["subnet-abc"]'; exit 1; } if [ -z "$SECURITY_GROUP_IDS" ]; then echo "Error: security-group-ids must be set when subnet-ids are provided." exit 1 fi - jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null 2>&1 <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } NETWORK_CONFIG=$(jq -cn --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi @@ -249,12 +249,12 @@ runs: exit 1 fi if [ -n "$SUBNET_IDS" ]; then - jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SUBNET_IDS" || { echo 'Error: subnet-ids must be a non-empty JSON array of strings, e.g. ["subnet-abc"]'; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null 2>&1 <<<"$SUBNET_IDS" || { echo 'Error: subnet-ids must be a non-empty JSON array of strings, e.g. ["subnet-abc"]'; exit 1; } if [ -z "$SECURITY_GROUP_IDS" ]; then echo "Error: security-group-ids must be set when subnet-ids are provided." exit 1 fi - jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } + jq -e 'type == "array" and length > 0 and all(.[]; type == "string")' >/dev/null 2>&1 <<<"$SECURITY_GROUP_IDS" || { echo 'Error: security-group-ids must be a non-empty JSON array of strings, e.g. ["sg-abc"]'; exit 1; } NETWORK_CONFIG=$(jq -cn --argjson subnets "$SUBNET_IDS" --argjson sgs "$SECURITY_GROUP_IDS" '{subnets: $subnets, securityGroups: $sgs}') NETWORK_ARGS=(--network-configuration "$NETWORK_CONFIG") fi From 551beb1256de67cbbee07ca6bdbf6f89df3acfeb Mon Sep 17 00:00:00 2001 From: tomarnebra <160740012+tomarnebra@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:11:43 +0200 Subject: [PATCH 09/10] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../deployment/preview/deploy-ecs-express-service/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml index 49105ed..dc6533d 100644 --- a/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml +++ b/.github/actions/deployment/preview/deploy-ecs-express-service/action.yml @@ -34,11 +34,11 @@ inputs: required: false default: '{}' subnet-ids: - description: 'JSON array of subnet IDs for the service, e.g. ["subnet-abc"].' + description: 'JSON array of subnet IDs for the service, e.g. ["subnet-abc"]. Must be provided together with security-group-ids.' required: false default: '' security-group-ids: - description: 'JSON array of security group IDs for the service, e.g. ["sg-abc"]. Required when subnet-ids is set.' + description: 'JSON array of security group IDs for the service, e.g. ["sg-abc"]. Must be provided together with subnet-ids.' required: false default: '' From 07e2ed7e609387d7ca06d5314a8cfe27f09e059d Mon Sep 17 00:00:00 2001 From: Tom Arne Date: Fri, 3 Jul 2026 14:36:19 +0200 Subject: [PATCH 10/10] Add optional subnet and security group IDs inputs for ECS Express deployment --- .../workflows/deployment.preview.on-comment.yml | 14 +++++++++++++- .github/workflows/deployment.preview.yml | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.preview.on-comment.yml b/.github/workflows/deployment.preview.on-comment.yml index 215ed20..baa8930 100644 --- a/.github/workflows/deployment.preview.on-comment.yml +++ b/.github/workflows/deployment.preview.on-comment.yml @@ -36,6 +36,16 @@ on: type: string default: '/' required: false + subnet-ids: + description: 'JSON array of subnet IDs for the ECS Express service, e.g. ["subnet-abc"]. Must be provided together with security-group-ids.' + required: false + type: string + default: '' + security-group-ids: + description: 'JSON array of security group IDs for the ECS Express service, e.g. ["sg-abc"]. Must be provided together with subnet-ids.' + required: false + type: string + default: '' jobs: trigger: @@ -66,7 +76,7 @@ jobs: preview: needs: trigger - uses: nsbno/platform-actions/.github/workflows/deployment.preview.yml@v2 + uses: nsbno/platform-actions/.github/workflows/deployment.preview.yml@vpc-option-preview-deployment with: health-endpoint: ${{ inputs.health-endpoint }} use-ecs-express-mode: ${{ inputs.use-ecs-express-mode }} @@ -78,6 +88,8 @@ jobs: skip-static-files-deployment: ${{ inputs.skip-static-files-deployment }} s3-static-files-path: ${{ inputs.s3-static-files-path }} custom-env-variables: ${{ inputs.custom-env-variables }} + subnet-ids: ${{ inputs.subnet-ids }} + security-group-ids: ${{ inputs.security-group-ids }} comment-handler: needs: [ trigger, preview ] diff --git a/.github/workflows/deployment.preview.yml b/.github/workflows/deployment.preview.yml index 459374f..011d18d 100644 --- a/.github/workflows/deployment.preview.yml +++ b/.github/workflows/deployment.preview.yml @@ -60,6 +60,16 @@ on: type: string default: '/' required: false + subnet-ids: + description: 'JSON array of subnet IDs for the ECS Express service, e.g. ["subnet-abc"]. Must be provided together with security-group-ids.' + required: false + type: string + default: '' + security-group-ids: + description: 'JSON array of security group IDs for the ECS Express service, e.g. ["sg-abc"]. Must be provided together with subnet-ids.' + required: false + type: string + default: '' permissions: contents: read @@ -165,7 +175,7 @@ jobs: - name: Deploy Preview (ECS) if: ${{ inputs.use-ecs-express-mode == true && (inputs.only-on-preview-comment == false || steps.check-comments.outputs.continue == 'true') }} id: deploy-ecs - uses: nsbno/platform-actions/.github/actions/deployment/preview/deploy-ecs-express-service@v2 + uses: nsbno/platform-actions/.github/actions/deployment/preview/deploy-ecs-express-service@vpc-option-preview-deployment with: health-endpoint: ${{ inputs.health-endpoint }} service-name: ${{ steps.deployment-info.outputs.ecs-service-name }} @@ -176,6 +186,8 @@ jobs: aws-region: ${{ vars.AWS_REGION }} git-event-number: ${{ inputs.git-event-number }} custom-env-variables: ${{ inputs.custom-env-variables }} + subnet-ids: ${{ inputs.subnet-ids }} + security-group-ids: ${{ inputs.security-group-ids }} - name: Push Mapping to DynamoDB and Comment domain name if: ${{ inputs.only-on-preview-comment == false || steps.check-comments.outputs.continue == 'true' }}