From f0a68fb30050b0fb0ca46c664a94ab282d5a7d96 Mon Sep 17 00:00:00 2001 From: xpk Date: Thu, 20 Aug 2020 11:56:49 +0800 Subject: [PATCH] UPD: minor changes --- vpc-subnets/outputs.tf | 11 +++++++++++ vpc-subnets/vpc.tf | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 vpc-subnets/outputs.tf diff --git a/vpc-subnets/outputs.tf b/vpc-subnets/outputs.tf new file mode 100644 index 0000000..9193b16 --- /dev/null +++ b/vpc-subnets/outputs.tf @@ -0,0 +1,11 @@ +output vpc_id { + value = module.vpc01.vpc_id +} + +output public_subnets { + value = module.vpc01.public_subnets +} + +output private_subnets { + value = module.vpc01.private_subnets +} diff --git a/vpc-subnets/vpc.tf b/vpc-subnets/vpc.tf index 4311c63..bf693ab 100644 --- a/vpc-subnets/vpc.tf +++ b/vpc-subnets/vpc.tf @@ -8,7 +8,7 @@ module "random" { source = "./m.random" } -module "vpc" { +module "vpc01" { source = "terraform-aws-modules/vpc/aws" version = "2.47.0" @@ -25,7 +25,7 @@ module "vpc" { # enable_ssm_endpoint = true # ssm_endpoint_private_dns_enabled = true # ssm_endpoint_security_group_ids = [aws_security_group.endpoint-sg.id] - # ssm_endpoint_subnet_ids = module.vpc.public_subnets + # ssm_endpoint_subnet_ids = module.vpc01.public_subnets tags = local.default-tags @@ -33,13 +33,13 @@ module "vpc" { resource "aws_security_group" "endpoint-sg" { name = "endpoint-sg" - vpc_id = module.vpc.vpc_id + vpc_id = module.vpc01.vpc_id ingress { description = "Allow within VPC" from_port = 0 to_port = 0 protocol = "-1" - cidr_blocks = [module.vpc.vpc_cidr_block] + cidr_blocks = [module.vpc01.vpc_cidr_block] } egress { from_port = 0