diff --git a/tf/output.tf b/tf/output.tf index ef0576ae..4d1b8375 100644 --- a/tf/output.tf +++ b/tf/output.tf @@ -14,3 +14,8 @@ output "elasticsearch_password" { description = "The Elasticsearch password" sensitive = true } + +output "aws_region" { + value = var.aws_region + description = "The AWS region" +} diff --git a/tf/test.sh b/tf/test.sh index 3280828e..7885f495 100755 --- a/tf/test.sh +++ b/tf/test.sh @@ -15,9 +15,11 @@ echo "-> Creating the underlying infrastructure..." terraform init | tee tf.log terraform apply -auto-approve | tee -a tf.log +AWS_REGION=$(terraform output -raw aws_region) + echo "-> Calling the lambda function..." -aws lambda invoke --region=eu-central-1 --function-name smoke-testing-test response.json -aws lambda invoke --region=eu-central-1 --function-name smoke-testing-test response.json +aws lambda invoke --region="${AWS_REGION}" --function-name smoke-testing-test response.json +aws lambda invoke --region="${AWS_REGION}" --function-name smoke-testing-test response.json echo "-> Waiting for the agent documents to be indexed in Elasticsearch..."