1
0

initial commit

This commit is contained in:
xpk
2026-02-13 15:44:24 +08:00
parent 66be8224f4
commit 09ce4c881a
570 changed files with 61807 additions and 0 deletions
@@ -0,0 +1,23 @@
{
"assume_role_arn": {
"value": ""
},
"aws_cli_commands": {
"value": [
"s3api",
"list-objects",
"--bucket",
"ryft-public-sample-data",
"--no-sign-request"
]
},
"aws_cli_query": {
"value": "max_by(Contents, &Size)"
},
"debug_log_filename": {
"value": "test-reports/test_with_debug/debug.log"
},
"role_session_name": {
"value": "test_with_debug"
}
}
@@ -0,0 +1,5 @@
// ryft-public-sample-data is a publicly accessible S3 bucket.
aws_cli_commands = ["s3api", "list-objects", "--bucket", "ryft-public-sample-data", "--no-sign-request"]
aws_cli_query = "max_by(Contents, &Size)"
debug_log_filename = "test-reports/test_with_debug/debug.log"
role_session_name = "test_with_debug"
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
function run_test() {
if [[ ! -f $PLAN_FILE ]]; then
echo "Failed to generate a plan - $PLAN_FILE";
exit 1;
fi
if [[ ! "$(terraform show -json $PLAN_FILE | jq -MSr .variables)" == "$(cat $EXPECTED_VARIABLES)" ]]; then
echo 'Failed to incorporate expected variable values into plan.';
exit 2;
fi
terraform apply -auto-approve -backup=- -state-out $STATE_FILE -var-file $TERRAFORM_TFVARS > $APPLY_LOG_FILE 2> $APPLY_ERROR_FILE
if [[ ! -f $STATE_FILE ]]; then
echo "Failed to generate state file - $STATE_FILE";
exit 3;
fi
# Extract some content the state file.
if [[ ! "$(cat $STATE_FILE)" == *'0ae8f910a30bc83fd81c4e3c1a6bbd9bab0afe4e0762b56a2807d22fcd77d517'* ]]; then
echo 'Failed to retrieve expected content from AWS.';
exit 4;
fi
# Extract some content from the apply log.
if [[ ! "$(cat $APPLY_LOG_FILE)" == *"0ae8f910a30bc83fd81c4e3c1a6bbd9bab0afe4e0762b56a2807d22fcd77d517"* ]]; then
echo 'Failed to present expected content to Terraform.';
exit 5;
fi
# Validate the presence of the debug log.
if [[ ! -f $DEBUG_LOG_FILE ]]; then
echo "Failed to generate debug.log file - $DEBUG_LOG_FILE";
exit 6;
fi
}
. tests/common.sh $0