diff --git a/README.md b/README.md index 778998212313176c1f26bd4a3e2b42418b6c8fb2..3fcf3244ac51702351869cafb7c429fd8aa7f609 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # cloud-monitor +## Run some integration tests + +```bash +docker run --rm -itv $PWD:/etc/newman/ postman/newman run --env-var endpoint={api_gateway_endpoint} Lambda_CRUD.postman_collection.json +``` + +Useful for testing and/or generate logs. diff --git a/deploy/api-gateway.tf b/deploy/api-gateway.tf index 91282bd347286a8d5acf8003a2a4a2e7bf6fc672..f8443d9eb855838b89dd259185a47b6812ba3ba4 100644 --- a/deploy/api-gateway.tf +++ b/deploy/api-gateway.tf @@ -82,10 +82,11 @@ resource "aws_api_gateway_deployment" "main" { } resource "aws_api_gateway_stage" "main" { - deployment_id = aws_api_gateway_deployment.main.id - rest_api_id = aws_api_gateway_rest_api.main.id - stage_name = terraform.workspace == "production" ? "api" : terraform.workspace - tags = local.common_tags + deployment_id = aws_api_gateway_deployment.main.id + rest_api_id = aws_api_gateway_rest_api.main.id + stage_name = terraform.workspace == "production" ? "api" : terraform.workspace + xray_tracing_enabled = true + tags = local.common_tags } resource "aws_api_gateway_method_settings" "general_settings" { diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 4263e73d8a238df5f7776e7c02409143944c3b64..beb2ec4c8005312eeac94024a5e2e9b410cca052 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.7' services: terraform: - image: hashicorp/terraform:0.14.7 + image: hashicorp/terraform:0.14.8 volumes: - .:/infra working_dir: /infra diff --git a/deploy/lambda.tf b/deploy/lambda.tf index 9406a4a8ee13f002425291a4a9fc8e939b118fc6..19235e3a73b992c8c86d222d89e43535135aedac 100644 --- a/deploy/lambda.tf +++ b/deploy/lambda.tf @@ -16,6 +16,10 @@ resource "aws_lambda_function" "crud" { "arn:aws:lambda:eu-west-1:580247275435:layer:LambdaInsightsExtension:14" ] + tracing_config { + mode = "Active" + } + environment { variables = { TABLE_NAME = aws_dynamodb_table.main.name