From c8d844a7a2cb807f1d5356baab5eacad09b0cd8a Mon Sep 17 00:00:00 2001 From: Rajat Tomar Date: Fri, 27 Jan 2023 09:05:29 +0530 Subject: [PATCH 1/2] Refactor examples directory structure --- .gitignore | 5 ++--- README.md | 4 ++++ examples/{ => gitlab-shell-runner-setup}/main.tf | 2 +- examples/{ => gitlab-shell-runner-setup}/outputs.tf | 0 examples/{ => gitlab-shell-runner-setup}/variables.tf | 0 examples/{ => gitlab-shell-runner-setup}/versions.tf | 0 6 files changed, 7 insertions(+), 4 deletions(-) rename examples/{ => gitlab-shell-runner-setup}/main.tf (95%) rename examples/{ => gitlab-shell-runner-setup}/outputs.tf (100%) rename examples/{ => gitlab-shell-runner-setup}/variables.tf (100%) rename examples/{ => gitlab-shell-runner-setup}/versions.tf (100%) diff --git a/.gitignore b/.gitignore index 48edb83..c7ab02c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .idea/ terraform.tfstate* .terraform* -examples/terraform.tfstate* -examples/.terraform* -.infracost/ +examples/gitlab-shell-runner-setup/terraform.tfstate* +examples/gitlab-shell-runner-setup.terraform* diff --git a/README.md b/README.md index 30302a2..6184ffa 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ module "gitlab_shell_runner" { } ``` +## Examples + +[Example](examples/gitlab-shell-runner-setup) + ## Requirements diff --git a/examples/main.tf b/examples/gitlab-shell-runner-setup/main.tf similarity index 95% rename from examples/main.tf rename to examples/gitlab-shell-runner-setup/main.tf index b747c77..9b94000 100644 --- a/examples/main.tf +++ b/examples/gitlab-shell-runner-setup/main.tf @@ -1,5 +1,5 @@ module "gitlab_shell_runner" { - source = "../" + source = "../../" ami_id = "ami-0addfae420fd47aab" instance_type = "t2.micro" diff --git a/examples/outputs.tf b/examples/gitlab-shell-runner-setup/outputs.tf similarity index 100% rename from examples/outputs.tf rename to examples/gitlab-shell-runner-setup/outputs.tf diff --git a/examples/variables.tf b/examples/gitlab-shell-runner-setup/variables.tf similarity index 100% rename from examples/variables.tf rename to examples/gitlab-shell-runner-setup/variables.tf diff --git a/examples/versions.tf b/examples/gitlab-shell-runner-setup/versions.tf similarity index 100% rename from examples/versions.tf rename to examples/gitlab-shell-runner-setup/versions.tf From 05e415d98c76a16befe3f74f358a7f720b9ab5d8 Mon Sep 17 00:00:00 2001 From: Rajat Tomar Date: Fri, 27 Jan 2023 09:08:55 +0530 Subject: [PATCH 2/2] Update variable defaults --- examples/gitlab-shell-runner-setup/README.md | 30 ++++++++++++++++++++ examples/gitlab-shell-runner-setup/main.tf | 3 +- variables.tf | 2 ++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 examples/gitlab-shell-runner-setup/README.md diff --git a/examples/gitlab-shell-runner-setup/README.md b/examples/gitlab-shell-runner-setup/README.md new file mode 100644 index 0000000..40ccbe8 --- /dev/null +++ b/examples/gitlab-shell-runner-setup/README.md @@ -0,0 +1,30 @@ + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | ~> 1.3.0 | +| [aws](#requirement\_aws) | ~> 4.49.0 | + +## Providers + +No providers. + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [gitlab\_shell\_runner](#module\_gitlab\_shell\_runner) | ../../ | n/a | + +## Resources + +No resources. + +## Inputs + +No inputs. + +## Outputs + +No outputs. + diff --git a/examples/gitlab-shell-runner-setup/main.tf b/examples/gitlab-shell-runner-setup/main.tf index 9b94000..db04b2a 100644 --- a/examples/gitlab-shell-runner-setup/main.tf +++ b/examples/gitlab-shell-runner-setup/main.tf @@ -1,8 +1,7 @@ module "gitlab_shell_runner" { source = "../../" - ami_id = "ami-0addfae420fd47aab" - instance_type = "t2.micro" + instance_type = "t2.medium" instance_count = 2 vpc_security_group_ids = ["sg-0b0b0b0b0b0b0b0b0"] subnet_id = "subnet-0b0e1c4b5b1b1b1b1" diff --git a/variables.tf b/variables.tf index a5b9c1c..883f09f 100644 --- a/variables.tf +++ b/variables.tf @@ -7,11 +7,13 @@ variable "ami_id" { variable "instance_type" { description = "Type of instance to provision" type = string + default = "t2.micro" } variable "instance_count" { description = "Number of instances to provision" type = number + default = 1 } variable "vpc_security_group_ids" {