From 9a59ee4036d40265e1c83aa65ad8d5d80a23ae25 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:09:15 +0100 Subject: [PATCH] feat(ci-staging): add connection for rust-lang-ci gh org --- terragrunt/accounts/ci-staging/ci-runners/terragrunt.hcl | 3 ++- terragrunt/modules/ci-runners/codebuild.tf | 9 ++++++--- terragrunt/modules/ci-runners/iam.tf | 3 ++- terragrunt/modules/ci-runners/variables.tf | 8 ++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/terragrunt/accounts/ci-staging/ci-runners/terragrunt.hcl b/terragrunt/accounts/ci-staging/ci-runners/terragrunt.hcl index 5b67a69ba..09c5726ab 100644 --- a/terragrunt/accounts/ci-staging/ci-runners/terragrunt.hcl +++ b/terragrunt/accounts/ci-staging/ci-runners/terragrunt.hcl @@ -8,5 +8,6 @@ include { } inputs = { - code_connection_arn = "arn:aws:codeconnections:us-east-2:442426873467:connection/98864d5c-b905-4f8e-bd76-2f69cf181818" + rust_lang_code_connection_arn = "arn:aws:codeconnections:us-east-2:442426873467:connection/98864d5c-b905-4f8e-bd76-2f69cf181818" + rust_lang_ci_code_connection_arn = "arn:aws:codeconnections:us-east-2:442426873467:connection/dfa33048-75a5-4409-8700-5f099d558c52" } diff --git a/terragrunt/modules/ci-runners/codebuild.tf b/terragrunt/modules/ci-runners/codebuild.tf index e1c71db9d..17e4efef2 100644 --- a/terragrunt/modules/ci-runners/codebuild.tf +++ b/terragrunt/modules/ci-runners/codebuild.tf @@ -43,9 +43,12 @@ resource "aws_codebuild_project" "ubuntu_small" { source { type = "GITHUB" - // Dummy repository. - // TODO: can we put the real repos even if we use github app? - location = "https://github.com/rust-lang/infra-team.git" + // test repository + location = "https://github.com/rust-lang/aws-runners-test" git_clone_depth = 1 + + git_submodules_config { + fetch_submodules = false + } } } diff --git a/terragrunt/modules/ci-runners/iam.tf b/terragrunt/modules/ci-runners/iam.tf index 83f4a2de6..158f9890b 100644 --- a/terragrunt/modules/ci-runners/iam.tf +++ b/terragrunt/modules/ci-runners/iam.tf @@ -32,7 +32,8 @@ resource "aws_iam_role_policy" "codebuild_policy" { "codeconnections:GetConnection" ] Resource = [ - var.code_connection_arn + var.rust_lang_code_connection_arn, + var.rust_lang_ci_code_connection_arn ] } ] diff --git a/terragrunt/modules/ci-runners/variables.tf b/terragrunt/modules/ci-runners/variables.tf index bdb94c08d..9b8187d38 100644 --- a/terragrunt/modules/ci-runners/variables.tf +++ b/terragrunt/modules/ci-runners/variables.tf @@ -1,6 +1,10 @@ // Since you can't create the connection from the terraform provider (as of Dec 2024), // you need to create the connection manually at // https://us-east-2.console.aws.amazon.com/codesuite/settings/connections -variable "code_connection_arn" { - description = "Arn of the GitHub CodeConnection" +variable "rust_lang_code_connection_arn" { + description = "Arn of the GitHub CodeConnection for https://github.com/rust-lang" +} + +variable "rust_lang_ci_code_connection_arn" { + description = "Arn of the GitHub CodeConnection for https://github.com/rust-lang-ci" }