Commit ef915dc8 authored by Anton Babenko's avatar Anton Babenko

Updated VPC endpoint example (fixed #249)

parent 5b3e48d6
...@@ -2,24 +2,39 @@ provider "aws" { ...@@ -2,24 +2,39 @@ provider "aws" {
region = "us-east-1" region = "us-east-1"
} }
data "aws_security_group" "default" { #################
name = "default" # 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 vpc_id = module.vpc.vpc_id
ingress_cidr_blocks = ["0.0.0.0/0"]
} }
######
# VPC
######
module "vpc" { module "vpc" {
source = "../../" source = "../../"
name = "complete-example" name = "vpcendpoint-example"
cidr = "10.15.0.0/16" cidr = "10.15.0.0/16"
azs = ["us-east-1a"] azs = ["us-east-1a"]
private_subnets = ["10.15.1.0/24"] private_subnets = ["10.15.1.0/24"]
enable_dns_hostnames = true
enable_dns_support = true
# VPC endpoint for API gateway # VPC endpoint for API gateway
enable_apigw_endpoint = true 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 apigw_endpoint_private_dns_enabled = true
tags = { tags = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment