Skip to content

Commit 9ece69c

Browse files
committed
minor refactoring and readme updates
1 parent 7dd63f4 commit 9ece69c

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

Readme.org

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
- EXTERNAL
99

1010
We can set CODE_DEPLOY as deployment controller and achieve BLUE/GREEN deployment of the ECS Service unfortunately there is no support to manipulate DeploymentController properties through Cloudformation. You should either use API/CLI or build your own custom cloudformation.
11-
11+
#+CAPTION: Native CloudFormation showing error while creating blue/green ECS Service
12+
[[./images/bgService.png]]
1213
**** Creating Custom BG ECS service
1314
#+BEGIN_SRC shell
1415
git clone https://github.com/BalmanRawat/bgECSService.git

create-deployment-group/saml.yaml

+1-34
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,11 @@ Resources:
4343
Handler: main
4444
Runtime: go1.x
4545
Role: !GetAtt CreateBGServiceRole.Arn
46-
47-
CustomDeploymentGroup:
48-
Type: Custom::DeploymentGroup
49-
Properties:
50-
ServiceToken: !GetAtt CreateBGServiceLambda.Arn
51-
ClientToken: laksdfjsld
52-
ApplicationName: osho-cnm-codedeploy
53-
DeploymentGroupName: osho-cnm-codedeploy-dg-local
54-
DeploymentStyle:
55-
DeploymentType: BLUE_GREEN
56-
DeploymentOption: WITH_TRAFFIC_CONTROL
57-
EcsServices:
58-
- ClusterName: osho-cnm
59-
ServiceName: osho-cnm-config-api
60-
ServiceRoleArn: arn:aws:iam::574574226067:role/osho-codedeploy
61-
BlueGreenDeploymentConfiguration:
62-
DeploymentReadyOption:
63-
ActionOnTimeout: STOP_DEPLOYMENT
64-
WaitTimeInMinutes: '10'
65-
TerminateBlueInstancesOnDeploymentSuccess:
66-
Action: TERMINATE
67-
TerminationWaitTimeInMinutes: '15'
68-
LoadBalancerInfo:
69-
TargetGroupPairInfoList:
70-
-
71-
TargetGroups:
72-
- Name: osho-Targe-41657SP4W7LP
73-
- Name: osho-Targe-V7X8FJ8H9IA9
74-
ProdTrafficRoute:
75-
ListenerArns:
76-
- arn:aws:elasticloadbalancing:us-east-1:574574226067:listener/app/osho-LoadB-1JQEJL8NAAQX/578141fef28740fa/820d8ce9ab3e6e62
77-
TestTrafficRoute:
78-
ListenerArns:
79-
- arn:aws:elasticloadbalancing:us-east-1:574574226067:listener/app/osho-LoadB-1JQEJL8NAAQX/578141fef28740fa/1d4fbf67ce5bd09f
8046

8147
Outputs:
8248
CreateBGServiceLambdaArn:
8349
Description: Arn of the custom ECS service lambda
8450
Value: !GetAtt CreateBGServiceLambda.Arn
8551
Export:
8652
Name: !Join [':', [!Ref EnvironmentName, 'CreateBGServiceLambdaArn']]
53+

create-ecs-service/Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
build-binary:
2+
cd src && go mod download && \
3+
GOOS=linux GOARCH=amd64 go build -o main main.go
4+
package:
5+
sam package --template-file saml.yaml --output-template-file packaged.yaml --s3-bucket $(SAM_SOURCE_BUCKET)
6+
deploy: build-binary package
7+
sam deploy --template-file packaged.yaml --stack-name $(STACK_NAME) --capabilities CAPABILITY_IAM --parameter-overrides EnvironmentName=$(ENV_LABEL) SubSystem=$(SUB_SYSTEM)
8+
delete:
9+
aws cloudformation delete-stack --stack-name $(STACK_NAME)
10+
11+
test-local: build-binary
12+
sam local invoke --event events/create-request.json -t saml.yaml

images/bgService.png

188 KB
Loading

0 commit comments

Comments
 (0)