Skip to content

Commit

Permalink
Updated VPC endpoint example (fixed #249)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Jun 13, 2019
1 parent 5b3e48d commit ef915dc
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions examples/issue-224-vpcendpoint-apigw/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,39 @@ provider "aws" {
region = "us-east-1"
}

data "aws_security_group" "default" {
name = "default"
vpc_id = module.vpc.vpc_id
#################
# Security group
#################
module "http_sg" {
source = "terraform-aws-modules/security-group/aws//modules/http-80"
version = "~> 3.0"

name = "http-sg"
description = "Security group with HTTP ports open for everybody (IPv4 CIDR), egress ports are all world open"
vpc_id = module.vpc.vpc_id

ingress_cidr_blocks = ["0.0.0.0/0"]
}

######
# VPC
######
module "vpc" {
source = "../../"

name = "complete-example"
name = "vpcendpoint-example"

cidr = "10.15.0.0/16"

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

enable_dns_hostnames = true
enable_dns_support = true

# VPC endpoint for API gateway
enable_apigw_endpoint = true
apigw_endpoint_security_group_ids = [data.aws_security_group.default.id]
apigw_endpoint_security_group_ids = [module.http_sg.this_security_group_id]
apigw_endpoint_private_dns_enabled = true

tags = {
Expand Down

0 comments on commit ef915dc

Please sign in to comment.