diff --git a/examples/complete-gitlab-setup/backend.tf b/examples/complete-gitlab-setup/backend.tf new file mode 100644 index 0000000..031b4e4 --- /dev/null +++ b/examples/complete-gitlab-setup/backend.tf @@ -0,0 +1,7 @@ +terraform { + backend "s3" { + bucket = "gitlab-tf" + key = "gitlab/terraform.tfstate" + region = "ap-south-1" + } +} diff --git a/examples/complete-gitlab-setup/gitlab_config/gitlab_additional.rb b/examples/complete-gitlab-setup/gitlab_config/gitlab_additional.rb new file mode 100644 index 0000000..efe725e --- /dev/null +++ b/examples/complete-gitlab-setup/gitlab_config/gitlab_additional.rb @@ -0,0 +1,8 @@ +gitlab_rails['omniauth_providers'] = [ + { + name: "google_oauth2", + app_id: "google_oauth_app_id", + app_secret: "google_oauth_app_secret", + args: { access_type: "offline", approval_prompt: "" } + } +] diff --git a/examples/complete-gitlab-setup/main.tf b/examples/complete-gitlab-setup/main.tf new file mode 100644 index 0000000..56f582f --- /dev/null +++ b/examples/complete-gitlab-setup/main.tf @@ -0,0 +1,40 @@ +module "gitlab" { + source = "../../" + + create_gitlab_domain = true + gitlab_domain = "gitlab" + gitlab_fqdn = "gitlab.example.com" + hosted_zone = "example.com" + private_subnet_id = "subnet-u8dy389d78qhh338" + public_subnet_ids = [ + "subnet-h89dj8d3j2jd8", "subnet-jd8jq3dj89qj9jd3", "subnet-jd89jh89dj9dj9j9qw" + ] + volume_size = 30 + volume_type = "gp3" + vpc_id = "vpc-89rh423789hr982h98" + create_acm_certificate = true + healthcheck_matcher = "200" + healthcheck_path = "/-/readiness" + gitlab_ssh_public_key = "ssh publickey" + gitlab_pg_allocated_storage = 100 + gitlab_pg_db_instance_class = "db.m5.large" + gitlab_pg_db_name = "gitlabhq_production" + gitlab_pg_engine_version = "12.11" + gitlab_pg_password = "foobarbaz" + gitlab_pg_publicly_accessible = false + gitlab_pg_storage_type = "gp3" + gitlab_pg_subnet_ids = ["subnet-u8dy389d78qhh338", "subnet-hde38hd89qhdwhw"] + gitlab_pg_username = "gitlab" + gitlab_redis_engine_version = "7.0" + gitlab_redis_node_type = "cache.t3.medium" + gitlab_redis_create_parameter_group = true + gitlab_redis_parameter_group = { + name = "gitlab-redis" + family = "redis7" + } + gitlab_redis_subnet_ids = ["subnet-u8dy389d78qhh338", "subnet-hde38hd89qhdwhw"] + enable_gitlab_backup_to_s3 = true + gitlab_backup_bucket_name = "example-gitlab-backup" + private_key = var.private_key + create_ses_identity = true +} diff --git a/examples/complete-gitlab-setup/outputs.tf b/examples/complete-gitlab-setup/outputs.tf new file mode 100644 index 0000000..ff059dd --- /dev/null +++ b/examples/complete-gitlab-setup/outputs.tf @@ -0,0 +1,13 @@ +output "gitlab_pg_address" { + value = module.gitlab.gitlab_pg_address + description = "Gitlab Postgres address" +} + +output "gitlab_redis_address" { + value = module.gitlab.gitlab_redis_address + description = "Gitlab Redis address" +} + +output "gitlab_url" { + value = module.gitlab.gitlab_complete_url +} diff --git a/examples/complete-gitlab-setup/variables.tf b/examples/complete-gitlab-setup/variables.tf new file mode 100644 index 0000000..041b813 --- /dev/null +++ b/examples/complete-gitlab-setup/variables.tf @@ -0,0 +1,4 @@ +variable "private_key" { + type = string + description = "Private key to execute ansible playbook on Gitlab instance." +} diff --git a/examples/complete-gitlab-setup/versions.tf b/examples/complete-gitlab-setup/versions.tf new file mode 100644 index 0000000..449e883 --- /dev/null +++ b/examples/complete-gitlab-setup/versions.tf @@ -0,0 +1,14 @@ +terraform { + required_version = ">= 1.3" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.40" + } + null = { + source = "hashicorp/null" + version = ">= 3.2.1" + } + } +}