From 3a96b946c88ec29f663a8a32925271869c3dbce4 Mon Sep 17 00:00:00 2001 From: Mufaddal5253110 Date: Thu, 30 May 2024 09:53:30 +0530 Subject: [PATCH 1/2] Adding Simple Example for Reference --- examples/simple-setup/main.tf | 7 +++++++ .../simple-setup/terraform.tfvars.example | 3 +++ examples/simple-setup/variables.tf | 20 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 examples/simple-setup/main.tf create mode 100644 examples/simple-setup/terraform.tfvars.example create mode 100644 examples/simple-setup/variables.tf diff --git a/examples/simple-setup/main.tf b/examples/simple-setup/main.tf new file mode 100644 index 0000000..0a53561 --- /dev/null +++ b/examples/simple-setup/main.tf @@ -0,0 +1,7 @@ +module "github_actions_iam_role" { + source = "github.com/infraspecdev/terraform-aws-github-actions-iam-role?ref=main" + aws_account_id = var.aws_account_id + github_username = var.github_username + repository_names = var.repository_names + role_name = var.role_name +} \ No newline at end of file diff --git a/examples/simple-setup/terraform.tfvars.example b/examples/simple-setup/terraform.tfvars.example new file mode 100644 index 0000000..a9b9703 --- /dev/null +++ b/examples/simple-setup/terraform.tfvars.example @@ -0,0 +1,3 @@ +aws_account_id = "ACCOUNT_ID" +github_username = "GITHUB_USERNAME" +repository_names = "["REPO_NAME_1","REPO_NAME_1"]" diff --git a/examples/simple-setup/variables.tf b/examples/simple-setup/variables.tf new file mode 100644 index 0000000..83eefc2 --- /dev/null +++ b/examples/simple-setup/variables.tf @@ -0,0 +1,20 @@ +variable "aws_account_id" { + description = "The AWS Account ID" + type = string +} + +variable "github_username" { + description = "GitHub Username" + type = string +} + +variable "repository_names" { + description = "List of names of the GitHub repository that will be allowed to assume the role." + type = list(string) +} + +variable "role_name" { + description = "Name of the IAM Role" + type = string + default = "GitHubActionsRole" +} From a0da068e5cfbd037beb2f893a32070caba019496 Mon Sep 17 00:00:00 2001 From: Mufaddal5253110 Date: Thu, 30 May 2024 09:54:39 +0530 Subject: [PATCH 2/2] formatting --- examples/simple-setup/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple-setup/main.tf b/examples/simple-setup/main.tf index 0a53561..d0bf56f 100644 --- a/examples/simple-setup/main.tf +++ b/examples/simple-setup/main.tf @@ -4,4 +4,4 @@ module "github_actions_iam_role" { github_username = var.github_username repository_names = var.repository_names role_name = var.role_name -} \ No newline at end of file +}