Skip to content

Commit

Permalink
Merge branch 'main' of github.com:navapbc/template-infra
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenyu committed Jul 9, 2024
2 parents caafd72 + 027ef5c commit 45b2e14
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 84 deletions.
16 changes: 8 additions & 8 deletions infra/accounts/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
output "project_name" {
value = module.project_config.project_name
}

output "account_id" {
value = data.aws_caller_identity.current.account_id
}

output "region" {
value = data.aws_region.current.name
output "project_name" {
value = module.project_config.project_name
}

output "tf_state_bucket_name" {
value = module.backend.tf_state_bucket_name
output "region" {
value = data.aws_region.current.name
}

output "tf_log_bucket_name" {
Expand All @@ -21,3 +17,7 @@ output "tf_log_bucket_name" {
output "tf_locks_table_name" {
value = module.backend.tf_locks_table_name
}

output "tf_state_bucket_name" {
value = module.backend.tf_state_bucket_name
}
12 changes: 6 additions & 6 deletions infra/app/app-config/env-config/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ output "database_config" {
value = local.database_config
}

output "incident_management_service_integration" {
value = var.has_incident_management_service ? {
integration_url_param_name = "/monitoring/${var.app_name}/${var.environment}/incident-management-integration-url"
} : null
}

output "network_name" {
value = var.network_name
}
Expand Down Expand Up @@ -38,9 +44,3 @@ output "storage_config" {
bucket_name = local.bucket_name
}
}

output "incident_management_service_integration" {
value = var.has_incident_management_service ? {
integration_url_param_name = "/monitoring/${var.app_name}/${var.environment}/incident-management-integration-url"
} : null
}
16 changes: 8 additions & 8 deletions infra/app/app-config/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ output "app_name" {
value = local.app_name
}

output "build_repository_config" {
value = local.build_repository_config
}

output "environment_configs" {
value = local.environment_configs
}

output "environments" {
value = local.environments
}
Expand All @@ -26,14 +34,6 @@ output "image_repository_name" {
value = local.image_repository_name
}

output "build_repository_config" {
value = local.build_repository_config
}

output "environment_configs" {
value = local.environment_configs
}

output "shared_network_name" {
value = local.shared_network_name
}
26 changes: 13 additions & 13 deletions infra/app/service/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
output "service_endpoint" {
description = "The public endpoint for the service."
value = module.service.public_endpoint
}

output "service_cluster_name" {
value = module.service.cluster_name
}

output "service_name" {
value = local.service_config.service_name
}

output "application_log_group" {
value = module.service.application_log_group
}
Expand All @@ -22,3 +9,16 @@ output "application_log_stream_prefix" {
output "migrator_role_arn" {
value = module.service.migrator_role_arn
}

output "service_cluster_name" {
value = module.service.cluster_name
}

output "service_endpoint" {
description = "The public endpoint for the service."
value = module.service.public_endpoint
}

output "service_name" {
value = local.service_config.service_name
}
8 changes: 4 additions & 4 deletions infra/modules/domain/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
output "hosted_zone_name_servers" {
value = length(aws_route53_zone.zone) > 0 ? aws_route53_zone.zone[0].name_servers : []
}

output "certificate_arns" {
value = {
for domain in keys(var.certificate_configs) : domain => aws_acm_certificate.issued[domain].arn
}
}

output "hosted_zone_name_servers" {
value = length(aws_route53_zone.zone) > 0 ? aws_route53_zone.zone[0].name_servers : []
}
10 changes: 5 additions & 5 deletions infra/modules/feature-flags/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
output "evidently_project_name" {
description = "Name of AWS Evidently feature flags project"
value = local.evidently_project_name
}

output "access_policy_arn" {
description = "Policy that allows access to query feature flag values"
value = aws_iam_policy.access_policy.arn
}

output "evidently_project_name" {
description = "Name of AWS Evidently feature flags project"
value = local.evidently_project_name
}
22 changes: 11 additions & 11 deletions infra/modules/service/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
output "public_endpoint" {
description = "The public endpoint for the service."
value = "http://${aws_lb.alb.dns_name}"
output "application_log_group" {
value = local.log_group_name
}

output "application_log_stream_prefix" {
value = local.log_stream_prefix
}

output "cluster_name" {
Expand All @@ -12,15 +15,12 @@ output "load_balancer_arn_suffix" {
value = aws_lb.alb.arn_suffix
}

output "application_log_group" {
value = local.log_group_name
}

output "application_log_stream_prefix" {
value = local.log_stream_prefix
}

output "migrator_role_arn" {
description = "ARN for role to use for migration"
value = length(aws_iam_role.migrator_task) > 0 ? aws_iam_role.migrator_task[0].arn : null
}

output "public_endpoint" {
description = "The public endpoint for the service."
value = "http://${aws_lb.alb.dns_name}"
}
8 changes: 4 additions & 4 deletions infra/modules/terraform-backend-s3/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output "tf_state_bucket_name" {
value = aws_s3_bucket.tf_state.bucket
output "tf_locks_table_name" {
value = aws_dynamodb_table.terraform_lock.name
}

output "tf_log_bucket_name" {
value = aws_s3_bucket.tf_log.bucket
}

output "tf_locks_table_name" {
value = aws_dynamodb_table.terraform_lock.name
output "tf_state_bucket_name" {
value = aws_s3_bucket.tf_state.bucket
}
8 changes: 4 additions & 4 deletions infra/networks/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output "hosted_zone_name_servers" {
value = module.domain.hosted_zone_name_servers
output "certificate_arns" {
value = module.domain.certificate_arns
}

output "certificate_domains" {
value = keys(local.domain_config.certificate_configs)
}

output "certificate_arns" {
value = module.domain.certificate_arns
output "hosted_zone_name_servers" {
value = module.domain.hosted_zone_name_servers
}
33 changes: 16 additions & 17 deletions infra/project-config/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
output "project_name" {
value = local.project_name
}

output "owner" {
value = local.owner
output "aws_services" {
description = "AWS services that this project uses"
value = local.aws_services
}

output "code_repository_url" {
value = local.code_repository_url
output "aws_services_security_group_name_prefix" {
value = local.aws_services_security_group_name_prefix
}

output "code_repository" {
value = regex("([-_\\w]+/[-_\\w]+)(\\.git)?$", local.code_repository_url)[0]
description = "The 'org/repo' string of the repo (e.g. 'navapbc/template-infra'). This is extracted from the repo URL (e.g. '[email protected]:navapbc/template-infra.git' or 'https://github.com/navapbc/template-infra.git')"
}

output "code_repository_url" {
value = local.code_repository_url
}

output "default_region" {
value = local.default_region
}

# Common tags for all accounts and environments
output "default_tags" {
value = {
project = local.project_name
owner = local.owner
repository = local.code_repository_url
terraform = true
terraform_workspace = terraform.workspace
# description is set in each environments local use key project_description if required.
# description is set in each environments local use key project_description if required.
}
}

output "github_actions_role_name" {
value = local.github_actions_role_name
}

output "aws_services" {
description = "AWS services that this project uses"
value = local.aws_services
output "network_configs" {
value = local.network_configs
}

output "aws_services_security_group_name_prefix" {
value = local.aws_services_security_group_name_prefix
output "owner" {
value = local.owner
}

output "network_configs" {
value = local.network_configs
output "project_name" {
value = local.project_name
}
9 changes: 6 additions & 3 deletions template-only-test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ module github.com/navapbc/template-infra

go 1.19

require (
github.com/gruntwork-io/terratest v0.40.24
github.com/stretchr/testify v1.7.0
)

require (
cloud.google.com/go v0.83.0 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
Expand All @@ -20,7 +25,6 @@ require (
github.com/google/uuid v1.2.0 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/gruntwork-io/go-commons v0.8.0 // indirect
github.com/gruntwork-io/terratest v0.40.24 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.6.1 // indirect
Expand All @@ -40,7 +44,6 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/otp v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/tmccombs/hcl2json v0.3.3 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/urfave/cli v1.22.2 // indirect
Expand All @@ -59,6 +62,6 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.38.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
14 changes: 13 additions & 1 deletion template-only-test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M=
github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -139,9 +140,12 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -192,6 +196,7 @@ github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a/go.mod h1:yL958EeXv8
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
Expand All @@ -202,11 +207,14 @@ github.com/klauspost/compress v1.13.0 h1:2T7tUoQrQT+fQWdaY5rjWztFGAFwbGD04iPJg90
github.com/klauspost/compress v1.13.0/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down Expand Up @@ -431,6 +439,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM=
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -605,14 +614,17 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down

0 comments on commit 45b2e14

Please sign in to comment.