generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
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 #5400 from ministryofjustice/feature/extend-ap-ing…
…estion-vpc 🌐 Extend Analytical Platform Ingestion's VPC
- Loading branch information
Showing
9 changed files
with
95 additions
and
78 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
terraform/environments/analytical-platform-ingestion/application_variables.json
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
terraform/environments/analytical-platform-ingestion/environment-configuration.tf
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,27 @@ | ||
locals { | ||
environment_configuration = local.environment_configurations[local.environment] | ||
environment_configurations = { | ||
development = { | ||
/* VPC */ | ||
vpc_cidr = "10.0.0.0/16" | ||
vpc_private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | ||
vpc_public_subnets = ["10.0.11.0/24", "10.0.12.0/24", "10.0.13.0/24"] | ||
vpc_enable_nat_gateway = true | ||
vpc_one_nat_gateway_per_az = true | ||
|
||
/* Observability Platform */ | ||
observability_platform = "development" | ||
} | ||
production = { | ||
/* VPC */ | ||
vpc_cidr = "10.0.0.0/16" | ||
vpc_private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | ||
vpc_public_subnets = ["10.0.11.0/24", "10.0.12.0/24", "10.0.13.0/24"] | ||
vpc_enable_nat_gateway = true | ||
vpc_one_nat_gateway_per_az = true | ||
|
||
/* Observability Platform */ | ||
observability_platform = "production" | ||
} | ||
} | ||
} |
5 changes: 0 additions & 5 deletions
5
terraform/environments/analytical-platform-ingestion/locals.tf
This file was deleted.
Oops, something went wrong.
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
1 change: 0 additions & 1 deletion
1
terraform/environments/analytical-platform-ingestion/secrets.tf
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
terraform/environments/analytical-platform-ingestion/security-group-rules.tf
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,9 @@ | ||
resource "aws_security_group_rule" "vpc_endpoints_allow_all_vpc" { | ||
cidr_blocks = [module.vpc.vpc_cidr_block] | ||
description = "Allow all traffic in from VPC CIDR" | ||
from_port = 0 | ||
protocol = -1 | ||
security_group_id = aws_security_group.vpc_endpoints.id | ||
to_port = 65535 | ||
type = "ingress" | ||
} |
6 changes: 6 additions & 0 deletions
6
terraform/environments/analytical-platform-ingestion/security-groups.tf
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,6 @@ | ||
resource "aws_security_group" "vpc_endpoints" { | ||
description = "Security Group for controlling all VPC endpoint traffic" | ||
name = format("%s-vpc-endpoint-sg", local.application_name) | ||
vpc_id = module.vpc.vpc_id | ||
tags = local.tags | ||
} |
44 changes: 44 additions & 0 deletions
44
terraform/environments/analytical-platform-ingestion/vpc-endpoints.tf
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,44 @@ | ||
module "vpc_endpoints" { | ||
#checkov:skip=CKV_TF_1:Module registry does not support commit hashes for versions | ||
|
||
source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints" | ||
version = "~> 5.0" | ||
|
||
vpc_id = module.vpc.vpc_id | ||
subnet_ids = module.vpc.private_subnets | ||
security_group_ids = [aws_security_group.vpc_endpoints.id] | ||
|
||
endpoints = { | ||
logs = { | ||
service = "logs" | ||
service_type = "Interface" | ||
private_dns_enabled = true | ||
tags = merge( | ||
local.tags, | ||
{ Name = format("%s-logs-vpc-endpoint", local.application_name) } | ||
) | ||
}, | ||
sts = { | ||
service = "sts" | ||
service_type = "Interface" | ||
private_dns_enabled = true | ||
tags = merge( | ||
local.tags, | ||
{ Name = format("%s-sts-vpc-endpoint", local.application_name) } | ||
) | ||
}, | ||
s3 = { | ||
service = "s3" | ||
service_type = "Gateway" | ||
route_table_ids = flatten([ | ||
module.vpc.default_route_table_id, | ||
module.vpc.private_route_table_ids, | ||
module.vpc.public_route_table_ids | ||
]) | ||
tags = merge( | ||
local.tags, | ||
{ Name = format("%s-s3-vpc-endpoint", local.application_name) } | ||
) | ||
} | ||
} | ||
} |
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