Skip to content

Commit 772fc71

Browse files
committed
Fix custom name of s3 bucket
1 parent 31b106d commit 772fc71

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

setup.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function variables_from_context() {
1313

1414
ACCOUNT_ID=$(${AWS_CMD} sts get-caller-identity | jq -r .Account)
1515

16+
# use the default bucket?
17+
if [ -z "${CONTAINER_REGISTRY_BUCKET}" ]; then
18+
CONTAINER_REGISTRY_BUCKET="container-registry-${CLUSTER_NAME}-${ACCOUNT_ID}"
19+
fi
20+
1621
CREATE_S3_BUCKET="false"
17-
if "${AWS_CMD}" s3api head-bucket --bucket "${CONTAINER_REGISTRY_BUCKET}" 2>/dev/null; then
22+
if ! "${AWS_CMD}" s3api head-bucket --bucket "${CONTAINER_REGISTRY_BUCKET}" >/dev/null 2>&1; then
1823
CREATE_S3_BUCKET="true"
1924
fi
2025

@@ -23,6 +28,7 @@ function variables_from_context() {
2328
export AWS_REGION
2429
export ACCOUNT_ID
2530
export CREATE_S3_BUCKET
31+
export CONTAINER_REGISTRY_BUCKET
2632
}
2733

2834
function check_prerequisites() {
@@ -61,10 +67,6 @@ function check_prerequisites() {
6167
else
6268
echo "Using external-dns. No manual intervention required."
6369
fi
64-
65-
if [ -z "${CONTAINER_REGISTRY_BUCKET}" ]; then
66-
CONTAINER_REGISTRY_BUCKET="container-registry-${CLUSTER_NAME}-${ACCOUNT_ID}"
67-
fi
6870
}
6971

7072
# Bootstrap AWS CDK - https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html

0 commit comments

Comments
 (0)