Skip to content

Commit ef915dc

Browse files
committed
Updated VPC endpoint example (fixed #249)
1 parent 5b3e48d commit ef915dc

File tree

1 file changed

+20
-5
lines changed
  • examples/issue-224-vpcendpoint-apigw

1 file changed

+20
-5
lines changed

examples/issue-224-vpcendpoint-apigw/main.tf

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,39 @@ provider "aws" {
22
region = "us-east-1"
33
}
44

5-
data "aws_security_group" "default" {
6-
name = "default"
7-
vpc_id = module.vpc.vpc_id
5+
#################
6+
# Security group
7+
#################
8+
module "http_sg" {
9+
source = "terraform-aws-modules/security-group/aws//modules/http-80"
10+
version = "~> 3.0"
11+
12+
name = "http-sg"
13+
description = "Security group with HTTP ports open for everybody (IPv4 CIDR), egress ports are all world open"
14+
vpc_id = module.vpc.vpc_id
15+
16+
ingress_cidr_blocks = ["0.0.0.0/0"]
817
}
918

19+
######
20+
# VPC
21+
######
1022
module "vpc" {
1123
source = "../../"
1224

13-
name = "complete-example"
25+
name = "vpcendpoint-example"
1426

1527
cidr = "10.15.0.0/16"
1628

1729
azs = ["us-east-1a"]
1830
private_subnets = ["10.15.1.0/24"]
1931

32+
enable_dns_hostnames = true
33+
enable_dns_support = true
34+
2035
# VPC endpoint for API gateway
2136
enable_apigw_endpoint = true
22-
apigw_endpoint_security_group_ids = [data.aws_security_group.default.id]
37+
apigw_endpoint_security_group_ids = [module.http_sg.this_security_group_id]
2338
apigw_endpoint_private_dns_enabled = true
2439

2540
tags = {

0 commit comments

Comments
 (0)