Skip to content

Commit

Permalink
Merge pull request #44 from rnzsgh/sk-hostname-dev
Browse files Browse the repository at this point in the history
Fargate service hostname routing & updates
  • Loading branch information
rnzsgh authored Sep 10, 2018
2 parents f8193f8 + 19e9f32 commit 4cd9e75
Show file tree
Hide file tree
Showing 17 changed files with 364 additions and 184 deletions.
175 changes: 95 additions & 80 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/aurora.cfn.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
AWSTemplateFormatVersion: 2010-09-09

Description: Aurora
Description: SASKV5N Aurora

# Create the Aurora MySQL or PostgreSQL database(s). Currently, this template only supports alarms for Aurora MySQL.

Expand Down
54 changes: 29 additions & 25 deletions templates/bastion.cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AWSTemplateFormatVersion: '2010-09-09'
# bastion, see the following AWS blog post:
# https://aws.amazon.com/blogs/security/securely-connect-to-linux-instances-running-in-a-private-amazon-vpc/

Description: Bastion
Description: SASKV5N Bastion


Parameters:
Expand Down Expand Up @@ -41,36 +41,40 @@ Mappings:
# Amazon Linux AMI - https://aws.amazon.com/amazon-linux-ami/
# Note: This has not been tested with Amazon Linux 2
AMIMap:
ap-northeast-1:
AMI: ami-ceafcba8

us-east-1:
AMI: ami-0ff8a91507f77f867
us-west-1:
AMI: ami-0bdb828fd58c52235
ap-northeast-3:
AMI: ami-0d98120a9fb693f07
ap-northeast-2:
AMI: ami-863090e8
ap-south-1:
AMI: ami-531a4c3c
AMI: ami-0a10b2721688ce9d2
ap-northeast-1:
AMI: ami-06cd52961ce9f0d85
sa-east-1:
AMI: ami-07b14488da8ea02a0
ap-southeast-1:
AMI: ami-68097514
AMI: ami-08569b978cc4dfa10
ca-central-1:
AMI: ami-0b18956f
ap-southeast-2:
AMI: ami-942dd1f6
AMI: ami-09b42976632b27e9b
us-west-2:
AMI: ami-a0cfeed8
us-east-2:
AMI: ami-0b59bfac6be064b78
ap-south-1:
AMI: ami-0912f71e06545ad88
eu-central-1:
AMI: ami-0233214e13e500f77
eu-west-1:
AMI: ami-d834aba1
AMI: ami-047bb4163c506cd98
eu-west-2:
AMI: ami-403e2524
AMI: ami-f976839e
eu-west-3:
AMI: ami-8ee056f3
eu-central-1:
AMI: ami-5652ce39
sa-east-1:
AMI: ami-84175ae8
us-east-1:
AMI: ami-97785bed
us-east-2:
AMI: ami-f63b1193
us-west-1:
AMI: ami-824c4ee2
us-west-2:
AMI: ami-f2d3638a
ca-central-1:
AMI: ami-a954d1cd
AMI: ami-0ebc281c20e89ba4b


Resources:

Expand Down
2 changes: 1 addition & 1 deletion templates/db.cfn.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
AWSTemplateFormatVersion: 2010-09-09

Description: RDS
Description: SASKV5N RDS

# Database stack creation prerequisite: First create a VPC stack - see README for more info
Parameters:
Expand Down
22 changes: 11 additions & 11 deletions templates/devops.cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ Parameters:
Resources:

# METRIC FILTERS

LoginLatencyMetricFilter:
Type: "AWS::Logs::MetricFilter"
Properties:
LogGroupName:
Properties:
LogGroupName:
"Fn::Join":
- ''
- - '/aws/elasticbeanstalk/'
- !ImportValue
"Fn::Sub": "${AppStackName}-EnvironmentName"
- '/var/log/nodejs/nodejs.log'
FilterPattern: '[ timestamp, level, message = POST_AUTH_latency, latency ]'
MetricTransformations:
-
MetricTransformations:
-
MetricValue: $latency
MetricNamespace: STARTUP_KIT/API
MetricName: LOGIN_LATENCY

# ALARMS

LoginFailureAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
Expand All @@ -51,11 +51,11 @@ Resources:
ComparisonOperator: GreaterThanThreshold

# NOTIFICATION RESOURCES

StartupKitDevOpsSNSTopic:
Type: "AWS::SNS::Topic"
Properties:
Properties:
DisplayName: STARTUP_KIT_DEVOPS
TopicName: STARTUP_KIT_DEVOPS


15 changes: 7 additions & 8 deletions templates/elastic-beanstalk.cfn.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS Elastic Beanstalk app - built by AWS Startup Kit
Description: SASKV5N Elastic Beanstalk

# App stack creation prerequisites: first create a VPC stack, then a DB stack.

Description: Elastic Beanstalk

Parameters:

ApplicationName:
Expand Down Expand Up @@ -130,15 +129,15 @@ Mappings:
# Maps stack type parameter to solution stack name string
StackMap:
node:
stackName: 64bit Amazon Linux 2018.03 v4.5.0 running Node.js
stackName: 64bit Amazon Linux 2018.03 v4.5.3 running Node.js
rails:
stackName: 64bit Amazon Linux 2018.03 v2.8.0 running Ruby 2.4 (Puma)
stackName: 64bit Amazon Linux 2018.03 v2.8.3 running Ruby 2.4 (Puma)
spring:
stackName: 64bit Amazon Linux 2018.03 v3.0.0 running Tomcat 8 Java 8
stackName: 64bit Amazon Linux 2018.03 v3.0.3 running Tomcat 8 Java 8
python:
stackName: 64bit Amazon Linux 2018.03 v2.7.0 running Python 2.7
stackName: 64bit Amazon Linux 2018.03 v2.7.3 running Python 2.7
python3:
stackName: 64bit Amazon Linux 2018.03 v2.7.0 running Python 3.6
stackName: 64bit Amazon Linux 2018.03 v2.7.3 running Python 3.6

Resources:

Expand Down
38 changes: 19 additions & 19 deletions templates/elasticache.cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ AWSTemplateFormatVersion: 2010-09-09
# This template is released under Apache Version 2.0, and can be forked, copied, modified,
# customized, etc. to match your application/system requirements.

Description: ElastiCache and related resources
Description: SASKV5N ElastiCache and related resources

Parameters:

# ElastiCache stack creation prerequisite: First create a VPC stack - see README for more info
NetworkStackName:
Description: Active CloudFormation stack containing VPC resources
Type: String
MinLength: 1
MaxLength: 255
AllowedPattern: "^[a-zA-Z][-a-zA-Z0-9]*$"

ClusterName:
Description: Custom name of the cluster. Auto generated if you don't supply your own.
Type: String
AllowedPattern: "^[a-zA-Z][-a-zA-Z0-9]*$"

CacheNodeType:
Description: Cache node instance class, e.g. cache.t2.micro(free tier). See https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheNodes.SelectSize.html
Type: String
Expand All @@ -50,7 +50,7 @@ Parameters:
- cache.r4.4xlarge
- cache.r4.8xlarge
- cache.r4.16xlarge

CacheEngine:
Description: The underlying cache engine, either Redis or Memcached
Type: String
Expand All @@ -59,15 +59,15 @@ Parameters:
AllowedValues:
- redis
- memcached

CacheNodeCount:
Description: Number of nodes in the cluster. Only used with memcached engine, for redis this value will be set to 1.
Type: Number
MinValue: 1
MaxValue: 15
ConstraintDescription: Node count must be between 1 and 15
Default: 1

AutoMinorVersionUpgrade:
Description: Whether or not minor version upgrades to the cache engine should be applied automatically during the maintenance window.
Type: String
Expand All @@ -77,9 +77,9 @@ Parameters:
- false

Conditions:

IsRedis: !Equals [ !Ref CacheEngine, redis]

Resources:

SecurityGroup:
Expand All @@ -93,15 +93,15 @@ Resources:
IpProtocol: tcp
FromPort: !If [ IsRedis, 6379, 11211]
ToPort: !If [ IsRedis, 6379, 11211]
SubnetGroup:

SubnetGroup:
Type: AWS::ElastiCache::SubnetGroup
Properties:
Properties:
Description: Cache Subnet Group
SubnetIds:
- Fn::ImportValue: !Sub ${NetworkStackName}-PrivateSubnet1ID
- Fn::ImportValue: !Sub ${NetworkStackName}-PrivateSubnet2ID

ElastiCacheCluster:
Type: AWS::ElastiCache::CacheCluster
Properties:
Expand All @@ -116,39 +116,39 @@ Resources:
Tags:
- Key: Name
Value: !Ref AWS::StackName

Outputs:

ElastiCacheStackName:
Description: ElastiCache Stack Name
Value: !Ref AWS::StackName
Export:
Name: !Sub ${AWS::StackName}-ElastiCacheName

ElastiCacheClusterArn:
Description: ElastiCache Cluster Arn
Value: !Sub arn:aws:elasticache:${AWS::Region}:${AWS::AccountId}:cluster/${ElastiCacheCluster}
Export:
Name: !Sub ${AWS::StackName}-ElastiCacheClusterArn

ElastiCacheClusterId:
Description: ElastiCache Cluster ID
Value: !Ref ElastiCacheCluster
Export:
Name: !Sub ${AWS::StackName}-ElastiCacheClusterID

ElastiCacheEngine:
Description: ElastiCache engine
Value: !Ref CacheEngine
Export:
Name: !Sub ${AWS::StackName}-ElastiCacheEngine

ElastiCacheAddress:
Description: ElastiCache endpoint address
Value: !If [ IsRedis, !GetAtt ElastiCacheCluster.RedisEndpoint.Address, !GetAtt ElastiCacheCluster.ConfigurationEndpoint.Address]
Export:
Name: !Sub ${AWS::StackName}-ElastiCacheAddress

ElastiCachePort:
Description: ElastiCache port
Value: !If [ IsRedis, 6379, 11211]
Expand Down
Loading

0 comments on commit 4cd9e75

Please sign in to comment.