Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,21 @@ jobs:
run: sleep 60

- name: Terraform destroy
if: always()
run: |
cd "${{ inputs.module_source }}"
set -uo pipefail
set +e
set -x

terraform destroy -input=false -auto-approve -no-color > >(tee /dev/tty) 2> >(tee destroy.out >&2) EXIT_CODE=$?
terraform destroy -input=false -auto-approve -no-color > >(tee /dev/tty) 2> >(tee destroy.out >&2)
EXIT_CODE=$?
set -e

if [ "$EXIT_CODE" -ne 0 ]; then
echo "::error title=Terraform Destroy Failed::Check summary for details"

echo "## ❌ Terraform Apply Failed" >> $GITHUB_STEP_SUMMARY
echo "## ❌ Terraform Destroy Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Module:** ${{ inputs.module_source }} " >> $GITHUB_STEP_SUMMARY
echo "**Test:** ${{ matrix.label }}" >> $GITHUB_STEP_SUMMARY
Expand All @@ -225,7 +227,7 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🧾 Error Output" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
tail -n 50 apply.out >> $GITHUB_STEP_SUMMARY
tail -n 50 destroy.out >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

exit 1
Expand Down
2 changes: 1 addition & 1 deletion delivery/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "rules" {
product_id = var.product_id
etls = var.etls
default_origin = var.default_origin
cpcode_id = tonumber(trimprefix(akamai_cp_code.this[0].id, "cpc_"))
cpcode_id = var.default_cpcode ? null : tonumber(trimprefix(akamai_cp_code.this[0].id, "cpc_"))
cpcode_name = var.cpcode_name
sure_route_test_object = var.sure_route_test_object
td_region = var.td_region
Expand Down
2 changes: 1 addition & 1 deletion delivery/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ output "rules_errors" {
}

output "cpcode_id" {
value = tonumber(trimprefix(akamai_cp_code.this[0].id, "cpc_"))
value = var.default_cpcode ? 0 : tonumber(trimprefix(akamai_cp_code.this[0].id, "cpc_"))
description = "The CP Code's unique identifier."
}

Expand Down
2 changes: 1 addition & 1 deletion delivery/tests/tfvars.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default_origin = "flexibleorigin.rafa.cr"
forward_host_header = "flexibleorigin.rafa.cr"
notification_emails = ["test@akamai.com"]
version_notes = "GitHub Actions test"
certificate_id = 30192
certificate_id = 307307
peer_reviewed_by = "test@na.com"
customer_email = "test@akamai.com"
unit_tested = true
Expand Down
Loading