From 5bd30aacd3ae4e02e83251cfe0b099052725bf85 Mon Sep 17 00:00:00 2001 From: David Sibley Date: Mon, 30 Oct 2023 15:41:42 +0000 Subject: [PATCH] added uniqueness to role name --- test/unit-test/main.tf | 6 +++++- test/unit-test/versions.tf | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/unit-test/main.tf b/test/unit-test/main.tf index 004e0ad..8229569 100644 --- a/test/unit-test/main.tf +++ b/test/unit-test/main.tf @@ -1,8 +1,12 @@ +resource "random_id" "role" { + byte_length = 1 +} module "module_test" { source = "../../" - github_repositories = ["ministryofjustice/modernisation-platform-environments:*", "ministryofjustice/modernisation-platform-ami-builds:*"] additional_permissions = data.aws_iam_policy_document.extra_permissions.json + github_repositories = ["ministryofjustice/modernisation-platform-environments:*", "ministryofjustice/modernisation-platform-ami-builds:*"] + role_name = format("github-actions-%s", random_id.role.dec) tags_common = local.tags tags_prefix = terraform.workspace } diff --git a/test/unit-test/versions.tf b/test/unit-test/versions.tf index 54a5e6e..545f3fa 100644 --- a/test/unit-test/versions.tf +++ b/test/unit-test/versions.tf @@ -4,6 +4,10 @@ terraform { version = "~> 5.0" source = "hashicorp/aws" } + random = { + source = "hashicorp/random" + version = "~> 3.5" + } } required_version = ">= 1.0.1" }