Skip to content

Commit 48facd8

Browse files
authored
Merge pull request #2 from infraspecdev/complete-example
add example for gitlab omnibus setup using terraform-aws-gitlab module
2 parents 90a3280 + ea40907 commit 48facd8

File tree

6 files changed

+86
-0
lines changed

6 files changed

+86
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
backend "s3" {
3+
bucket = "gitlab-tf"
4+
key = "gitlab/terraform.tfstate"
5+
region = "ap-south-1"
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
gitlab_rails['omniauth_providers'] = [
2+
{
3+
name: "google_oauth2",
4+
app_id: "google_oauth_app_id",
5+
app_secret: "google_oauth_app_secret",
6+
args: { access_type: "offline", approval_prompt: "" }
7+
}
8+
]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module "gitlab" {
2+
source = "../../"
3+
4+
create_gitlab_domain = true
5+
gitlab_domain = "gitlab"
6+
gitlab_fqdn = "gitlab.example.com"
7+
hosted_zone = "example.com"
8+
private_subnet_id = "subnet-u8dy389d78qhh338"
9+
public_subnet_ids = [
10+
"subnet-h89dj8d3j2jd8", "subnet-jd8jq3dj89qj9jd3", "subnet-jd89jh89dj9dj9j9qw"
11+
]
12+
volume_size = 30
13+
volume_type = "gp3"
14+
vpc_id = "vpc-89rh423789hr982h98"
15+
create_acm_certificate = true
16+
healthcheck_matcher = "200"
17+
healthcheck_path = "/-/readiness"
18+
gitlab_ssh_public_key = "ssh publickey"
19+
gitlab_pg_allocated_storage = 100
20+
gitlab_pg_db_instance_class = "db.m5.large"
21+
gitlab_pg_db_name = "gitlabhq_production"
22+
gitlab_pg_engine_version = "12.11"
23+
gitlab_pg_password = "foobarbaz"
24+
gitlab_pg_publicly_accessible = false
25+
gitlab_pg_storage_type = "gp3"
26+
gitlab_pg_subnet_ids = ["subnet-u8dy389d78qhh338", "subnet-hde38hd89qhdwhw"]
27+
gitlab_pg_username = "gitlab"
28+
gitlab_redis_engine_version = "7.0"
29+
gitlab_redis_node_type = "cache.t3.medium"
30+
gitlab_redis_create_parameter_group = true
31+
gitlab_redis_parameter_group = {
32+
name = "gitlab-redis"
33+
family = "redis7"
34+
}
35+
gitlab_redis_subnet_ids = ["subnet-u8dy389d78qhh338", "subnet-hde38hd89qhdwhw"]
36+
enable_gitlab_backup_to_s3 = true
37+
gitlab_backup_bucket_name = "example-gitlab-backup"
38+
private_key = var.private_key
39+
create_ses_identity = true
40+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
output "gitlab_pg_address" {
2+
value = module.gitlab.gitlab_pg_address
3+
description = "Gitlab Postgres address"
4+
}
5+
6+
output "gitlab_redis_address" {
7+
value = module.gitlab.gitlab_redis_address
8+
description = "Gitlab Redis address"
9+
}
10+
11+
output "gitlab_url" {
12+
value = module.gitlab.gitlab_complete_url
13+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
variable "private_key" {
2+
type = string
3+
description = "Private key to execute ansible playbook on Gitlab instance."
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
terraform {
2+
required_version = ">= 1.3"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 4.40"
8+
}
9+
null = {
10+
source = "hashicorp/null"
11+
version = ">= 3.2.1"
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)