Skip to content

Commit 41f8139

Browse files
authored
Small fix of sub-cert length
1 parent 2ee1835 commit 41f8139

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/generate_deploy.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ aws_resource_identifier_supershort="aws_resource_identifier_supershort = \"${GIT
6565
aws_r53_sub_domain_name=
6666
if [ -n "${AWS_R53_SUB_DOMAIN_NAME}" ]; then
6767
aws_r53_sub_domain_name="aws_r53_sub_domain_name = \"${AWS_R53_SUB_DOMAIN_NAME}\""
68+
concatenated_string="${AWS_R53_SUB_DOMAIN_NAME}.${AWS_R53_DOMAIN_NAME}"
69+
if [ ${#concatenated_string} -gt 64 ] && [[ $(alpha_only "$AWS_R53_CREATE_SUB_CERT") == "true" ]] ; then
70+
echo "Length of FQDN exceeds 64 characters. Reduce length of it."
71+
echo "You can use a root domain cert with a wildcard or define one through the inputs."
72+
exit 64
73+
fi
6874
else
6975
concatenated_string="${GITHUB_IDENTIFIER}.${AWS_R53_DOMAIN_NAME}"
70-
if [ ${#concatenated_string} -gt 64 ] && [[ $(alpha_only "$AWS_SITE_CDN_ENABLED") == "false" ]] ; then
76+
if [ ${#concatenated_string} -gt 64 ] && [[ $(alpha_only "$AWS_R53_CREATE_SUB_CERT") == "true" ]] ; then
7177
aws_r53_sub_domain_name="aws_r53_sub_domain_name = \"${GITHUB_IDENTIFIER_SS}\""
7278
else
7379
aws_r53_sub_domain_name="aws_r53_sub_domain_name = \"${GITHUB_IDENTIFIER}\""
@@ -119,4 +125,4 @@ echo "Creating TF-STATE bucket"
119125
/bin/bash $GITHUB_ACTION_PATH/scripts/create_tf_state_bucket.sh
120126

121127
echo "Creating provider.tf"
122-
/bin/bash $GITHUB_ACTION_PATH/scripts/generate_provider.sh
128+
/bin/bash $GITHUB_ACTION_PATH/scripts/generate_provider.sh

0 commit comments

Comments
 (0)