-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from kpeder/feature/alb
Feature/alb
- Loading branch information
Showing
17 changed files
with
441 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
deletion_protection: false | ||
dns: | ||
- name: "gitlab" | ||
ttl: 600 | ||
type: "A" | ||
egress: | ||
all_tcp: | ||
cidr_ipv4: "172.16.0.0/16" | ||
from_port: 80 | ||
ip_protocol: "tcp" | ||
to_port: 80 | ||
ingress: | ||
all_https: | ||
cidr_ipv4: "0.0.0.0/0" | ||
description: "HTTPS traffic" | ||
from_port: 443 | ||
ip_protocol: "tcp" | ||
to_port: 443 | ||
labels: {} | ||
listeners: | ||
https: | ||
certificate_arn: "" | ||
forward: | ||
target_group_key: "gitlab" | ||
port: 443 | ||
protocol: "HTTPS" | ||
name: "gitlab" | ||
targets: | ||
gitlab: | ||
create_attachment: true | ||
health_check: | ||
enabled: true | ||
healthy_threshold: 2 | ||
interval: 30 | ||
matcher: "200" | ||
path: "/-/health" | ||
port: "traffic-port" | ||
protocol: "HTTP" | ||
timeout: 6 | ||
unhealthy_threshold: 3 | ||
name: "gitlab" | ||
port: 80 | ||
protocol: "HTTP" | ||
target_type: "instance" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
terraform { | ||
# Intentionally unconfigured. Managed by Terragrunt. | ||
backend "s3" {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the | ||
# working directory, into a temporary folder, and execute your Terraform commands in that folder. | ||
|
||
# Include all settings from the root terragrunt.hcl file | ||
include { | ||
path = find_in_parent_folders("aws_gitlab_terragrunt.hcl") | ||
} | ||
|
||
# Resources should not be destroyed without careful consideration of effects | ||
prevent_destroy = false | ||
|
||
locals { | ||
env = yamldecode(file(find_in_parent_folders("env.yaml"))) | ||
inputs = yamldecode(file("inputs.yaml")) | ||
platform = fileexists(find_in_parent_folders("local.aws.yaml")) ? yamldecode(file(find_in_parent_folders("local.aws.yaml"))) : yamldecode(file(find_in_parent_folders("aws.yaml"))) | ||
versions = yamldecode(file(find_in_parent_folders("versions.yaml"))) | ||
} | ||
|
||
dependency "custom_vpc" { | ||
config_path = find_in_parent_folders(local.env.dependencies.custom_vpc_dependency_path) | ||
mock_outputs = local.env.dependencies.custom_vpc_mock_outputs | ||
|
||
mock_outputs_allowed_terraform_commands = ["init", "plan", "validate"] | ||
} | ||
|
||
dependency "gitlab_certificate" { | ||
config_path = find_in_parent_folders(local.env.dependencies.gitlab_certificate_dependency_path) | ||
mock_outputs = local.env.dependencies.gitlab_certificate_mock_outputs | ||
|
||
mock_outputs_allowed_terraform_commands = ["init", "plan", "validate"] | ||
} | ||
|
||
dependency "gitlab_instance" { | ||
config_path = find_in_parent_folders(local.env.dependencies.gitlab_instance_dependency_path) | ||
mock_outputs = local.env.dependencies.gitlab_instance_mock_outputs | ||
|
||
mock_outputs_allowed_terraform_commands = ["init", "plan", "validate"] | ||
} | ||
|
||
terraform { | ||
source = "git::git@github.com:terraform-aws-modules/terraform-aws-alb?ref=${local.versions.aws_module_alb}" | ||
} | ||
|
||
inputs = { | ||
enable_deletion_protection = local.inputs.deletion_protection | ||
|
||
name = local.inputs.name | ||
subnets = dependency.custom_vpc.outputs.public_subnets | ||
vpc_id = dependency.custom_vpc.outputs.vpc_id | ||
|
||
listeners = merge({ | ||
for k, v in local.inputs.listeners: | ||
k => merge(v, | ||
{ | ||
certificate_arn = dependency.gitlab_certificate.outputs.acm_certificate_arn | ||
}) if contains(keys(v), "certificate_arn") | ||
},{ | ||
for k, v in local.inputs.listeners: | ||
k => v if !contains(keys(v), "certificate_arn") | ||
}) | ||
route53_records = { | ||
for v in local.inputs.dns: v.name => merge(v, | ||
{ | ||
zone_id = local.env.dns.zone_id | ||
}) | ||
} | ||
security_group_egress_rules = { for k, v in local.inputs.egress: k => v } | ||
security_group_ingress_rules = { for k, v in local.inputs.ingress: k => v } | ||
target_groups = { | ||
for k, v in local.inputs.targets: k => merge(v, | ||
{ | ||
target_id = dependency.gitlab_instance.outputs.id | ||
}) | ||
} | ||
|
||
tags = merge(local.env.labels, local.inputs.labels) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
labels: {} | ||
name: "gitlab" | ||
validation_method: "DNS" | ||
wait_for_validation: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
terraform { | ||
# Intentionally unconfigured. Managed by Terragrunt. | ||
backend "s3" {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the | ||
# working directory, into a temporary folder, and execute your Terraform commands in that folder. | ||
|
||
# Include all settings from the root terragrunt.hcl file | ||
include { | ||
path = find_in_parent_folders("aws_gitlab_terragrunt.hcl") | ||
} | ||
|
||
# Resources should not be destroyed without careful consideration of effects | ||
prevent_destroy = false | ||
|
||
locals { | ||
env = yamldecode(file(find_in_parent_folders("env.yaml"))) | ||
inputs = yamldecode(file("inputs.yaml")) | ||
platform = fileexists(find_in_parent_folders("local.aws.yaml")) ? yamldecode(file(find_in_parent_folders("local.aws.yaml"))) : yamldecode(file(find_in_parent_folders("aws.yaml"))) | ||
versions = yamldecode(file(find_in_parent_folders("versions.yaml"))) | ||
} | ||
|
||
terraform { | ||
source = "git::git@github.com:terraform-aws-modules/terraform-aws-acm?ref=${local.versions.aws_module_acm}" | ||
} | ||
|
||
inputs = { | ||
domain_name = local.env.dns.domain | ||
|
||
subject_alternative_names = [ | ||
format("%s.%s", local.inputs.name, local.env.dns.domain) | ||
] | ||
|
||
tags = merge(local.env.labels, local.inputs.labels) | ||
validation_method = "DNS" | ||
wait_for_validation = local.inputs.wait_for_validation | ||
zone_id = local.env.dns.zone_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
--- | ||
description: "Security group for network access to the GitLab instance" | ||
egress_cidr_blocks: [] | ||
egress_rules: [] | ||
egress_cidr_blocks: | ||
- "0.0.0.0/0" | ||
egress_rules: | ||
- "http-80-tcp" | ||
- "https-443-tcp" | ||
ingress_cidr_blocks: [] | ||
# order rules lexically, to match output and support testing | ||
ingress_rules: | ||
- "https-8443-tcp" | ||
- "http-80-tcp" | ||
- "https-443-tcp" | ||
- "ssh-tcp" | ||
labels: {} | ||
name: "gitlab" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.