-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ECO-2237] Abstract common indexer VPC resources (#297)
- move-v1.0.1-audited
- emojicoin-dot-fun-deployer-v0.0.7
- emojicoin-dot-fun-deployer-v0.0.6
- emojicoin-dot-fun-deployer-v0.0.5
- emojicoin-dot-fun-deployer-v0.0.4
- emojicoin-dot-fun-deployer-v0.0.3
- @econia-labs/emojicoin-sdk@0.2.0
- broker-v6.0.0
- broker-v6.0.0-alpha.3
- broker-v6.0.0-alpha.1
- broker-v6.0.0-alpha
- broker-v5.0.1
- broker-v5.0.0
- broker-v4.0.2
- broker-v4.0.1
- broker-v4.0.0
- broker-v3.0.1
- broker-v3.0.0
- broker-v2.2.0
- broker-v2.1.1
- broker-v2.0.1
- broker-v2.0.0
- broker-v1.1.0
- broker-v1.0.1
- broker-v1.0.1-rc.1
- broker-v1.0.0
- broker-v0.9.3
- broker-v0.9.2
- arena-move-v1.0.0-audited
Showing
5 changed files
with
446 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
parameters: null | ||
tags: null | ||
template-file-path: 'src/cloud-formation/vpc.cfn.yaml' | ||
... |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
--- | ||
Mappings: | ||
Constants: | ||
Vpc: | ||
CidrBlock: '10.0.0.0/16' | ||
PrivateSubnets: | ||
A: | ||
# Private subnet in first availability zone. | ||
AvailabilityZone: 0 | ||
CidrBlock: '10.0.0.0/19' | ||
B: | ||
# Private subnet in second availability zone. | ||
AvailabilityZone: 1 | ||
CidrBlock: '10.0.32.0/19' | ||
C: | ||
# Private subnet in third availability zone. | ||
AvailabilityZone: 2 | ||
CidrBlock: '10.0.64.0/19' | ||
PublicSubnets: | ||
A: | ||
# Public subnet in first availability zone. | ||
AvailabilityZone: 0 | ||
CidrBlock: '10.0.128.0/19' | ||
B: | ||
# Public subnet in second availability zone. | ||
AvailabilityZone: 1 | ||
CidrBlock: '10.0.160.0/19' | ||
C: | ||
# Public subnet in third availability zone. | ||
AvailabilityZone: 2 | ||
CidrBlock: '10.0.192.0/19' | ||
Outputs: | ||
DbSubnetGroupName: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-DbSubnetGroupName' | ||
Value: !Ref 'DbSubnetGroup' | ||
InstanceConnectEndpointSecurityGroupId: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-InstanceConnectEndpointSecurityGroupId' | ||
Value: !Ref 'InstanceConnectEndpointSecurityGroup' | ||
InternetGatewayId: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-InternetGatewayId' | ||
Value: !Ref 'InternetGateway' | ||
PrivateDnsNamespaceId: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PrivateDnsNamespaceId' | ||
Value: !Ref 'PrivateDnsNamespace' | ||
PrivateSubnetIdA: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PrivateSubnetIdA' | ||
Value: !Ref 'PrivateSubnetA' | ||
PrivateSubnetIdB: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PrivateSubnetIdB' | ||
Value: !Ref 'PrivateSubnetB' | ||
PrivateSubnetIdC: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PrivateSubnetIdC' | ||
Value: !Ref 'PrivateSubnetC' | ||
PublicSubnetIdA: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PublicSubnetIdA' | ||
Value: !Ref 'PublicSubnetA' | ||
PublicSubnetIdB: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PublicSubnetIdB' | ||
Value: !Ref 'PublicSubnetB' | ||
PublicSubnetIdC: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-PublicSubnetIdC' | ||
Value: !Ref 'PublicSubnetC' | ||
VpcId: | ||
Export: | ||
Name: !Sub '${AWS::StackName}-VpcId' | ||
Value: !Ref 'Vpc' | ||
Resources: | ||
# Database subnet group. | ||
DbSubnetGroup: | ||
Properties: | ||
DBSubnetGroupDescription: !Ref 'AWS::StackName' | ||
SubnetIds: | ||
- !Ref 'PrivateSubnetA' | ||
- !Ref 'PrivateSubnetB' | ||
- !Ref 'PrivateSubnetC' | ||
Type: 'AWS::RDS::DBSubnetGroup' | ||
# Network address translation gateway for each public subnet. | ||
Fn::ForEach::NatGateway: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- NatGateway${Identifier}: | ||
DependsOn: 'InternetGatewayAttachment' | ||
Properties: | ||
AllocationId: !GetAtt | ||
- !Sub 'NatGatewayEip${Identifier}' | ||
- 'AllocationId' | ||
SubnetId: !Ref | ||
Fn::Sub: 'PublicSubnet${Identifier}' | ||
Type: 'AWS::EC2::NatGateway' | ||
# Elastic IP address for each network address translation gateway. | ||
Fn::ForEach::NatGatewayEip: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- NatGatewayEip${Identifier}: | ||
Properties: | ||
Domain: 'vpc' | ||
Type: 'AWS::EC2::EIP' | ||
# Route table for each private subnet. | ||
Fn::ForEach::PrivateRouteTable: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- PrivateRouteTable${Identifier}: | ||
Properties: | ||
VpcId: !Ref 'Vpc' | ||
Type: 'AWS::EC2::RouteTable' | ||
# Association for each private route table within each private subnet. | ||
Fn::ForEach::PrivateRouteTableAssociation: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- PrivateRouteTableAssociation${Identifier}: | ||
Properties: | ||
RouteTableId: !Ref | ||
Fn::Sub: 'PrivateRouteTable${Identifier}' | ||
SubnetId: !Ref | ||
Fn::Sub: 'PrivateSubnet${Identifier}' | ||
Type: 'AWS::EC2::SubnetRouteTableAssociation' | ||
# Route through network address translation gateway for each private subnet. | ||
Fn::ForEach::PrivateRouteThroughNatGateway: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- PrivateRouteThroughNatGateway${Identifier}: | ||
DependsOn: | ||
- 'PrivateRouteTableAssociationA' | ||
- 'PrivateRouteTableAssociationB' | ||
- 'PrivateRouteTableAssociationC' | ||
Properties: | ||
DestinationCidrBlock: '0.0.0.0/0' | ||
NatGatewayId: !Ref | ||
Fn::Sub: 'NatGateway${Identifier}' | ||
RouteTableId: !Ref | ||
Fn::Sub: 'PrivateRouteTable${Identifier}' | ||
Type: 'AWS::EC2::Route' | ||
# A private subnet for each availability zone. | ||
Fn::ForEach::PrivateSubnet: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- PrivateSubnet${Identifier}: | ||
Properties: | ||
AvailabilityZone: !Select | ||
- !FindInMap | ||
- 'PrivateSubnets' | ||
- Ref: 'Identifier' | ||
- 'AvailabilityZone' | ||
- Fn::GetAZs: !Ref 'AWS::Region' | ||
CidrBlock: !FindInMap | ||
- 'PrivateSubnets' | ||
- Ref: 'Identifier' | ||
- 'CidrBlock' | ||
MapPublicIpOnLaunch: false | ||
VpcId: !Ref 'Vpc' | ||
Type: 'AWS::EC2::Subnet' | ||
# Association for public route table with each public subnet. | ||
Fn::ForEach::PublicRouteTableAssociation: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- PublicRouteTableAssociation${Identifier}: | ||
Properties: | ||
RouteTableId: !Ref 'PublicRouteTable' | ||
SubnetId: !Ref | ||
Fn::Sub: 'PublicSubnet${Identifier}' | ||
Type: 'AWS::EC2::SubnetRouteTableAssociation' | ||
# A public subnet for each availability zone. | ||
Fn::ForEach::PublicSubnet: | ||
- 'Identifier' | ||
- - 'A' | ||
- 'B' | ||
- 'C' | ||
- PublicSubnet${Identifier}: | ||
Properties: | ||
AvailabilityZone: !Select | ||
- !FindInMap | ||
- 'PublicSubnets' | ||
- Ref: 'Identifier' | ||
- 'AvailabilityZone' | ||
- Fn::GetAZs: !Ref 'AWS::Region' | ||
CidrBlock: !FindInMap | ||
- 'PublicSubnets' | ||
- Ref: 'Identifier' | ||
- 'CidrBlock' | ||
MapPublicIpOnLaunch: true | ||
VpcId: !Ref 'Vpc' | ||
Type: 'AWS::EC2::Subnet' | ||
# Instance connect endpoint. | ||
InstanceConnectEndpoint: | ||
Properties: | ||
PreserveClientIp: true | ||
SecurityGroupIds: | ||
- !Ref 'InstanceConnectEndpointSecurityGroup' | ||
SubnetId: !Ref 'PrivateSubnetA' | ||
Type: 'AWS::EC2::InstanceConnectEndpoint' | ||
# Security group for instance connect endpoint. | ||
InstanceConnectEndpointSecurityGroup: | ||
Properties: | ||
GroupDescription: !Ref 'AWS::StackName' | ||
VpcId: !Ref 'Vpc' | ||
Type: 'AWS::EC2::SecurityGroup' | ||
# Internet gateway for the virtual private cloud. | ||
InternetGateway: | ||
Type: 'AWS::EC2::InternetGateway' | ||
# Attachment of internet gateway to the virtual private cloud. | ||
InternetGatewayAttachment: | ||
Properties: | ||
InternetGatewayId: !Ref 'InternetGateway' | ||
VpcId: !Ref 'Vpc' | ||
Type: 'AWS::EC2::VPCGatewayAttachment' | ||
# Private DNS namespace for internal service discovery. | ||
PrivateDnsNamespace: | ||
Properties: | ||
Name: !Ref 'AWS::StackName' | ||
Vpc: !Ref 'Vpc' | ||
Type: 'AWS::ServiceDiscovery::PrivateDnsNamespace' | ||
# Route table for public subnets in the virtual private cloud. | ||
PublicRouteTable: | ||
Properties: | ||
VpcId: !Ref 'Vpc' | ||
Type: 'AWS::EC2::RouteTable' | ||
# Route from public subnets through the internet gateway. | ||
PublicRouteToInternet: | ||
DependsOn: | ||
- 'PublicRouteTableAssociationA' | ||
- 'PublicRouteTableAssociationB' | ||
- 'PublicRouteTableAssociationC' | ||
Properties: | ||
DestinationCidrBlock: '0.0.0.0/0' | ||
GatewayId: !Ref 'InternetGateway' | ||
RouteTableId: !Ref 'PublicRouteTable' | ||
Type: 'AWS::EC2::Route' | ||
# Virtual private cloud for internal networking. | ||
Vpc: | ||
Properties: | ||
CidrBlock: !FindInMap | ||
- 'Constants' | ||
- 'Vpc' | ||
- 'CidrBlock' | ||
EnableDnsHostnames: true | ||
EnableDnsSupport: true | ||
Type: 'AWS::EC2::VPC' | ||
Transform: 'AWS::LanguageExtensions' | ||
... |