Skip to content

Commit 9cda2be

Browse files
authored
fix: use unique name to avoid issues when running in the CI (#530)
1 parent 2755c04 commit 9cda2be

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/smoke-tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
SSH_KEY: "./id_rsa_terraform"
2424
TF_VAR_private_key: "./id_rsa_terraform"
2525
TF_VAR_public_key: "./id_rsa_terraform.pub"
26-
TF_VAR_user_name: "apm-aws-lambda-${{ github.run_id }}"
27-
26+
TF_VAR_github_workflow_id: "apm-aws-lambda-${{ github.run_id }}-${{ github.run_number }}"
2827
TF_VAR_BUILD_ID: "${{ github.run_id }}"
2928
TF_VAR_ENVIRONMENT: 'ci'
3029
TF_VAR_BRANCH: "${{ github.ref_name }}"

testing/smoketest/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ resource "aws_lambda_function" "test_lambda" {
103103
}
104104

105105
resource "aws_cloudwatch_log_group" "example" {
106-
name = "/aws/lambda/${local.user_name}-smoke-testing-test"
106+
name = "/aws/lambda/${local.user_name}-smoke-testing-test-${var.github_workflow_id}"
107107
retention_in_days = 1
108108
}
109109

@@ -122,7 +122,7 @@ data "aws_iam_policy_document" "lambda_logging" {
122122
}
123123

124124
resource "aws_iam_policy" "lambda_logging" {
125-
name = "smoketest_extension_lambda_logging"
125+
name = "${local.user_name}-smoke-testing-test-${var.github_workflow_id}"
126126
path = "/"
127127
description = "IAM policy for logging during smoketest for apm aws lambda extension"
128128
policy = data.aws_iam_policy_document.lambda_logging.json

testing/smoketest/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ variable "ess_version" {
3333
description = "ess version"
3434
default = "8.[0-9]?([0-9]).[0-9]?([0-9])$"
3535
}
36+
37+
variable "github_workflow_id" {
38+
type = string
39+
description = "The GitHub Workflow ID"
40+
default = "1"
41+
}

0 commit comments

Comments
 (0)