-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update packaging, documentation and CloudFormation deployment (#8)
* CloudFormation: Set up proper dependency relation between Listener and Target Group * Downgrade to node:10-alpine to overcome issues with fibers module installation * CloudFormation: add optional HTTPS listener if certificate is provided * CloudFormation: fix non-HTTPS deployment * CloudFormation: replace instances with auto-scaling group * CloudFormation: change default for desired count to 1 * Add helper shell script to build docker images * Add CloudFormation stack for netwrok resource and deployment documentation * Add operations guide * Add packaging description * Add references to different supplementary documents to README.md * Add periodic obsolete files (versions and bundles) deletion to builder container * Add environment variables to allow builder configuration overriding * CloudFormation: add environment variables for builder for easier overriding in case of need * Change builder to check for new version every 3 hours * Adjust documentation * Set proper permissions on scripts
- Loading branch information
Showing
14 changed files
with
489 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.* | ||
README.md | ||
*.sh | ||
!checkout.sh | ||
startup.sh | ||
todo.txt | ||
docker |
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
Empty file.
Empty file.
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,224 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Description: This stack creates a VPC constisting of two private and two public subnets, Internet Gateway, NAT Gateway | ||
|
||
Mappings: | ||
Subnets: | ||
VPC: | ||
CIDR: '172.54.0.0/16' | ||
PrivateOne: | ||
CIDR: '172.54.0.0/20' | ||
PrivateTwo: | ||
CIDR: '172.54.16.0/20' | ||
PublicOne: | ||
CIDR: '172.54.32.0/20' | ||
PublicTwo: | ||
CIDR: '172.54.48.0/20' | ||
|
||
Resources: | ||
# VPC | ||
VPC: | ||
Type: AWS::EC2::VPC | ||
Properties: | ||
EnableDnsSupport: true | ||
EnableDnsHostnames: false | ||
CidrBlock: !FindInMap ['Subnets', 'VPC', 'CIDR'] | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'vpc']] | ||
|
||
# Private subnets | ||
PrivateSubnetOne: | ||
Type: AWS::EC2::Subnet | ||
Properties: | ||
AvailabilityZone: | ||
Fn::Select: | ||
- 0 | ||
- Fn::GetAZs: {Ref: 'AWS::Region'} | ||
VpcId: !Ref VPC | ||
CidrBlock: !FindInMap ['Subnets', 'PrivateOne', 'CIDR'] | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'private-subnet-az1']] | ||
PrivateSubnetTwo: | ||
Type: AWS::EC2::Subnet | ||
Properties: | ||
AvailabilityZone: | ||
Fn::Select: | ||
- 1 | ||
- Fn::GetAZs: {Ref: 'AWS::Region'} | ||
VpcId: !Ref VPC | ||
CidrBlock: !FindInMap ['Subnets', 'PrivateTwo', 'CIDR'] | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'private-subnet-az2']] | ||
|
||
# Public subnets | ||
PublicSubnetOne: | ||
Type: AWS::EC2::Subnet | ||
Properties: | ||
AvailabilityZone: | ||
Fn::Select: | ||
- 0 | ||
- Fn::GetAZs: {Ref: 'AWS::Region'} | ||
VpcId: !Ref VPC | ||
CidrBlock: !FindInMap ['Subnets', 'PublicOne', 'CIDR'] | ||
MapPublicIpOnLaunch: true | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'public-subnet-az1']] | ||
PublicSubnetTwo: | ||
Type: AWS::EC2::Subnet | ||
Properties: | ||
AvailabilityZone: | ||
Fn::Select: | ||
- 1 | ||
- Fn::GetAZs: {Ref: 'AWS::Region'} | ||
VpcId: !Ref VPC | ||
CidrBlock: !FindInMap ['Subnets', 'PublicTwo', 'CIDR'] | ||
MapPublicIpOnLaunch: true | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'public-subnet-az2']] | ||
|
||
# Internet Gateway for public subnets | ||
InternetGateway: | ||
Type: AWS::EC2::InternetGateway | ||
Properties: | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'igw']] | ||
InternetGatewayAttachement: | ||
Type: AWS::EC2::VPCGatewayAttachment | ||
Properties: | ||
VpcId: !Ref VPC | ||
InternetGatewayId: !Ref InternetGateway | ||
|
||
# Route table for public subnets | ||
PublicRouteTable: | ||
Type: AWS::EC2::RouteTable | ||
Properties: | ||
VpcId: !Ref VPC | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'public-routing-table']] | ||
PublicRoute: | ||
Type: AWS::EC2::Route | ||
DependsOn: InternetGatewayAttachement | ||
Properties: | ||
RouteTableId: !Ref PublicRouteTable | ||
DestinationCidrBlock: '0.0.0.0/0' | ||
GatewayId: !Ref InternetGateway | ||
PublicSubnetOneRouteTableAssociation: | ||
Type: AWS::EC2::SubnetRouteTableAssociation | ||
Properties: | ||
SubnetId: !Ref PublicSubnetOne | ||
RouteTableId: !Ref PublicRouteTable | ||
PublicSubnetTwoRouteTableAssociation: | ||
Type: AWS::EC2::SubnetRouteTableAssociation | ||
Properties: | ||
SubnetId: !Ref PublicSubnetTwo | ||
RouteTableId: !Ref PublicRouteTable | ||
|
||
# NAT Gateways for private subnets | ||
NATGatewayOne: | ||
Type: AWS::EC2::NatGateway | ||
Properties: | ||
AllocationId: !GetAtt EIPNATOne.AllocationId | ||
SubnetId: !Ref PublicSubnetOne | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'nat-gw-az1']] | ||
NATGatewayTwo: | ||
Type: AWS::EC2::NatGateway | ||
Properties: | ||
AllocationId: !GetAtt EIPNATTwo.AllocationId | ||
SubnetId: !Ref PublicSubnetTwo | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'nat-gw-az2']] | ||
EIPNATOne: | ||
Type: AWS::EC2::EIP | ||
DependsOn: InternetGatewayAttachement | ||
Properties: | ||
Domain: vpc | ||
EIPNATTwo: | ||
Type: AWS::EC2::EIP | ||
DependsOn: InternetGatewayAttachement | ||
Properties: | ||
Domain: vpc | ||
|
||
# Route tables for private subnets | ||
PrivateRouteTableOne: | ||
Type: AWS::EC2::RouteTable | ||
Properties: | ||
VpcId: !Ref VPC | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'private-routing-table-az1']] | ||
PrivateRouteOne: | ||
Type: AWS::EC2::Route | ||
Properties: | ||
RouteTableId: !Ref PrivateRouteTableOne | ||
DestinationCidrBlock: 0.0.0.0/0 | ||
NatGatewayId: !Ref NATGatewayOne | ||
PrivateRouteTableOneAssociation: | ||
Type: AWS::EC2::SubnetRouteTableAssociation | ||
Properties: | ||
RouteTableId: !Ref PrivateRouteTableOne | ||
SubnetId: !Ref PrivateSubnetOne | ||
PrivateRouteTableTwo: | ||
Type: AWS::EC2::RouteTable | ||
Properties: | ||
VpcId: !Ref VPC | ||
Tags: | ||
- Key: 'Name' | ||
Value: !Join ['-', [!Ref 'AWS::StackName', 'private-routing-table-az2']] | ||
PrivateRouteTwo: | ||
Type: AWS::EC2::Route | ||
Properties: | ||
RouteTableId: !Ref PrivateRouteTableTwo | ||
DestinationCidrBlock: 0.0.0.0/0 | ||
NatGatewayId: !Ref NATGatewayTwo | ||
PrivateRouteTableTwoAssociation: | ||
Type: AWS::EC2::SubnetRouteTableAssociation | ||
Properties: | ||
RouteTableId: !Ref PrivateRouteTableTwo | ||
SubnetId: !Ref PrivateSubnetTwo | ||
|
||
# ECS cluster | ||
ECSCluster: | ||
Type: AWS::ECS::Cluster | ||
Properties: | ||
ClusterName: !Join ['-', [!Ref 'AWS::StackName', 'ecs-cluster']] | ||
|
||
Outputs: | ||
ClusterName: | ||
Description: The name of the ECS cluster | ||
Value: !Ref ECSCluster | ||
Export: | ||
Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ClusterName' ] ] | ||
VPCId: | ||
Description: The ID of the VPC that this stack is deployed in | ||
Value: !Ref VPC | ||
Export: | ||
Name: !Join [ ':', [ !Ref 'AWS::StackName', 'VPCId' ] ] | ||
PublicSubnetOne: | ||
Description: Public subnet one | ||
Value: !Ref PublicSubnetOne | ||
Export: | ||
Name: !Join [ ':', [ !Ref 'AWS::StackName', 'PublicSubnetOne' ] ] | ||
PublicSubnetTwo: | ||
Description: Public subnet two | ||
Value: !Ref PublicSubnetTwo | ||
Export: | ||
Name: !Join [ ':', [ !Ref 'AWS::StackName', 'PublicSubnetTwo' ] ] | ||
PrivateSubnetOne: | ||
Description: Private subnet one | ||
Value: !Ref PrivateSubnetOne | ||
Export: | ||
Name: !Join [ ':', [ !Ref 'AWS::StackName', 'PrivateSubnetOne' ] ] | ||
PrivateSubnetTwo: | ||
Description: Private subnet two | ||
Value: !Ref PrivateSubnetTwo | ||
Export: | ||
Name: !Join [ ':', [ !Ref 'AWS::StackName', 'PrivateSubnetTwo' ] ] |
Oops, something went wrong.