diff --git a/EksIp6Nginxpod/provider.tf b/EksIp6Nginxpod/provider.tf index 7144ce8..7394206 100644 --- a/EksIp6Nginxpod/provider.tf +++ b/EksIp6Nginxpod/provider.tf @@ -3,7 +3,6 @@ provider "aws" { default_tags { tags = { - ServiceProvider = "RackspaceTechnology" Environment = var.environment Project = var.project Application = var.application diff --git a/LocalStack/Compute/LabEc2/main.tf b/LocalStack/Compute/LabEc2/main.tf index 0b6e4b9..ee155bf 100644 --- a/LocalStack/Compute/LabEc2/main.tf +++ b/LocalStack/Compute/LabEc2/main.tf @@ -18,6 +18,7 @@ module "TestInstance" { instance_type = "t4g.large" subnet_id = data.terraform_remote_state.vpc.outputs.private_subnets[0] create_security_group = false + vpc_security_group_ids = [module.TestSg.id] root_block_device = { device_name = "/dev/xvda" type = "gp3" @@ -53,4 +54,20 @@ module "KmsKeys" { create-secret-key = false create-storage-key = false deletion_window_in_days = 7 +} + + +module "TestSg" { + source = "../../../modules/compute/security_group" + name = "example-sg" + description = "SG of EC2 bastion instances" + vpc-id = data.terraform_remote_state.vpc.outputs.vpc_id + ingress = { + r1 = "tcp,4750,4750,1.2.3.4/32,Patch Management Tool" + r2 = "tcp,22,22,1.2.3.4/32,Patch Management Tool" + } + egress = { + r1 = "-1,-1,-1,0.0.0.0/0,Allow egress ipv4" + r2 = "-1,-1,-1,::/0,Allow egress ipv6" + } } \ No newline at end of file diff --git a/LocalStack/Network/LabVpc/outputs.tf b/LocalStack/Network/LabVpc/outputs.tf index 0d42b7c..e767e8d 100644 --- a/LocalStack/Network/LabVpc/outputs.tf +++ b/LocalStack/Network/LabVpc/outputs.tf @@ -1,3 +1,11 @@ output "private_subnets" { value = module.vpc.private_subnets +} + +output "vpc_id" { + value = module.vpc.vpc_id +} + +output "vpc_cidr_block" { + value = module.vpc.vpc_cidr_block } \ No newline at end of file