Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brentley committed Feb 16, 2018
0 parents commit 3e05241
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Amazon ECS Workshop

This is part of an Amazon ECS workshop at https://ecsworkshop.com
29 changes: 29 additions & 0 deletions backend-service/common-iam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
Resources:
CloudFormationRole:
Type: AWS::IAM::Role
Properties:
RoleName:
Fn::Sub: ${Namespace}-cloudformation-common-${AWS::Region}
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service:
- cloudformation.amazonaws.com
Action:
- sts:AssumeRole
Path: "/"
Policies:
- PolicyName: update-route53-additional
PolicyDocument:
Version: '2012-10-17'
Statement:
- Action:
- route53:CreateHostedZone
- route53:GetHostedZone
- route53:DeleteHostedZone
- route53:UpdateHostedZoneComment
- route53:ListQueryLoggingConfigs
Resource: '*'
Effect: Allow
73 changes: 73 additions & 0 deletions backend-service/elb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
Resources:
DnsBackend:
Type: "AWS::Route53::HostedZone"
Properties:
Name: "internal.service"
VPCs:
-
VPCRegion:
Fn::Sub: ${AWS::Region}
VPCId:
Fn::ImportValue:
Fn::Sub: ${VpcId}
BackendLB:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Scheme: internal
SecurityGroups:
- Ref: ElbSG
Subnets:
Fn::Split:
- ','
- Fn::ImportValue:
Fn::Sub: ${ElbSubnetIds}
Tags:
- Key: Name
Value:
Ref: AWS::StackName
BackendLBHttpListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- TargetGroupArn:
Ref: BackendLBTargetGroup
Type: forward
LoadBalancerArn:
Ref: BackendLB
Port: "80"
Protocol: HTTP
BackendLBTargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Port: "8080"
Protocol: HTTP
Tags:
- Key: Name
Value: internal
VpcId:
Fn::ImportValue:
Fn::Sub: ${VpcId}
BackendLBDns:
Type: AWS::Route53::RecordSetGroup
Properties:
Comment: DNS for Internal ELB in ${AWS::StackName}
HostedZoneId:
Ref: DnsBackend
RecordSets:
- AliasTarget:
DNSName:
Fn::GetAtt: BackendLB.DNSName
EvaluateTargetHealth: true
HostedZoneId:
Fn::GetAtt: BackendLB.CanonicalHostedZoneID
Name: api.internal.service.
Type: A
Outputs:
BackendLBHttpListenerArn:
Description: Arn of the Backend ELB HTTP Listener.
Export:
Name:
Fn::Sub: ${AWS::StackName}-BackendLBHttpListenerArn
Value:
Ref: BackendLBHttpListener
8 changes: 8 additions & 0 deletions backend-service/mu-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: backend-service
version: 1.0

templateUpdateMode: merge

# Note: the filename must match the asset being extended.
# see https://github.com/stelligent/mu/tree/develop/templates/assets for
# filenames.
11 changes: 11 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 0.2

phases:
build:
commands:
- echo '...replace with real build commands...'

artifacts:
files:
- '**/*'

4 changes: 4 additions & 0 deletions images/web-app-ecs-architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions mu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
environments:
- name: acceptance
provider: ecs-fargate
- name: production
provider: ecs-fargate
service:
acceptance:
disabled: true
production:
disabled: true
extensions:
- url: backend-service

0 comments on commit 3e05241

Please sign in to comment.