diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index f5042b71..5a54e36b 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -23,8 +23,7 @@ jobs: SSH_KEY: "./id_rsa_terraform" TF_VAR_private_key: "./id_rsa_terraform" TF_VAR_public_key: "./id_rsa_terraform.pub" - TF_VAR_user_name: "apm-aws-lambda-${{ github.run_id }}" - + TF_VAR_github_workflow_id: "apm-aws-lambda-${{ github.run_id }}-${{ github.run_number }}" TF_VAR_BUILD_ID: "${{ github.run_id }}" TF_VAR_ENVIRONMENT: 'ci' TF_VAR_BRANCH: "${{ github.ref_name }}" diff --git a/testing/smoketest/main.tf b/testing/smoketest/main.tf index 60fa3454..f75c9bd6 100644 --- a/testing/smoketest/main.tf +++ b/testing/smoketest/main.tf @@ -103,7 +103,7 @@ resource "aws_lambda_function" "test_lambda" { } resource "aws_cloudwatch_log_group" "example" { - name = "/aws/lambda/${local.user_name}-smoke-testing-test" + name = "/aws/lambda/${local.user_name}-smoke-testing-test-${var.github_workflow_id}" retention_in_days = 1 } @@ -122,7 +122,7 @@ data "aws_iam_policy_document" "lambda_logging" { } resource "aws_iam_policy" "lambda_logging" { - name = "smoketest_extension_lambda_logging" + name = "${local.user_name}-smoke-testing-test-${var.github_workflow_id}" path = "/" description = "IAM policy for logging during smoketest for apm aws lambda extension" policy = data.aws_iam_policy_document.lambda_logging.json diff --git a/testing/smoketest/variables.tf b/testing/smoketest/variables.tf index f188dc06..b71cd547 100644 --- a/testing/smoketest/variables.tf +++ b/testing/smoketest/variables.tf @@ -33,3 +33,9 @@ variable "ess_version" { description = "ess version" default = "8.[0-9]?([0-9]).[0-9]?([0-9])$" } + +variable "github_workflow_id" { + type = string + description = "The GitHub Workflow ID" + default = "1" +}