mirror of
https://github.com/Sea-Haven-Industries/.github.git
synced 2026-09-30 08:13:12 +00:00
feat(ci): derive Fargate health URL from CloudFront (#150)
Callers that cannot add an SSM parameter to a shared permissions boundary can set health-from-distribution. The default still reads SSM api-url.
This commit is contained in:
parent
acaf2bfc0d
commit
bf14925fcf
1 changed files with 13 additions and 1 deletions
12
.github/workflows/cd-hcp-fargate.yaml
vendored
12
.github/workflows/cd-hcp-fargate.yaml
vendored
|
|
@ -87,6 +87,11 @@ on:
|
||||||
type: number
|
type: number
|
||||||
required: false
|
required: false
|
||||||
default: 6
|
default: 6
|
||||||
|
health-from-distribution:
|
||||||
|
description: "Build the health URL from SSM distribution-id and CloudFront GetDistribution. Leave false to read SSM api-url."
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
concurrency-suffix:
|
concurrency-suffix:
|
||||||
description: "Optional concurrency group suffix when two deployables share an SSM prefix"
|
description: "Optional concurrency group suffix when two deployables share an SSM prefix"
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -221,6 +226,7 @@ jobs:
|
||||||
id: deploy
|
id: deploy
|
||||||
env:
|
env:
|
||||||
SSM_PREFIX: ${{ inputs.ssm-prefix }}
|
SSM_PREFIX: ${{ inputs.ssm-prefix }}
|
||||||
|
HEALTH_FROM_DISTRIBUTION: ${{ inputs.health-from-distribution }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
get_param() {
|
get_param() {
|
||||||
|
|
@ -232,7 +238,13 @@ jobs:
|
||||||
FAMILY=$(get_param "${prefix}/task-family")
|
FAMILY=$(get_param "${prefix}/task-family")
|
||||||
ECR=$(get_param "${prefix}/ecr-repository")
|
ECR=$(get_param "${prefix}/ecr-repository")
|
||||||
CONTAINER=$(get_param "${prefix}/container-name")
|
CONTAINER=$(get_param "${prefix}/container-name")
|
||||||
|
if [ "${HEALTH_FROM_DISTRIBUTION}" = "true" ]; then
|
||||||
|
DIST_ID=$(get_param "${prefix}/distribution-id")
|
||||||
|
DOMAIN=$(aws cloudfront get-distribution --id "${DIST_ID}" --query Distribution.DomainName --output text)
|
||||||
|
API_URL="https://${DOMAIN}"
|
||||||
|
else
|
||||||
API_URL=$(get_param "${prefix}/api-url")
|
API_URL=$(get_param "${prefix}/api-url")
|
||||||
|
fi
|
||||||
{
|
{
|
||||||
echo "cluster=${CLUSTER}"
|
echo "cluster=${CLUSTER}"
|
||||||
echo "service=${SERVICE}"
|
echo "service=${SERVICE}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue