Last active
April 12, 2022 12:44
-
-
Save cp-sumi-k/c1a83c89ebb1e5990b16e575ce3f812e to your computer and use it in GitHub Desktop.
https://blog.canopas.com/complete-guide-to-deploying-ssr-vite-apps-on-aws-with-automation-27676113d6ac - ECS service
This file contains hidden or 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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: An ECS, ECR, ALB and cloudfront stack | |
Resources: | |
ECSService: | |
Type: AWS::ECS::Service | |
DependsOn: | |
- HTTPListener | |
- HTTPSListener | |
Properties: | |
LaunchType: FARGATE #launch type is farget | |
Cluster: | |
Ref: "ECSCluster" #ecs cluster reference | |
DesiredCount: 1 | |
TaskDefinition: | |
Ref: "TaskDefinition" #task definition reference | |
DeploymentConfiguration: | |
MaximumPercent: 100 | |
MinimumHealthyPercent: 0 | |
NetworkConfiguration: | |
AwsvpcConfiguration: | |
AssignPublicIp: ENABLED | |
SecurityGroups: | |
- !GetAtt ApplicationLBToECSSecurityGroup.GroupId #security group id | |
Subnets: [<SUBNET-ID-1>, <SUBNET-ID-2>] #can add multiple subnet ids | |
LoadBalancers: | |
- TargetGroupArn: | |
Ref: TargetGroup #target group reference | |
ContainerPort: 3000 | |
ContainerName: < ECR-CONTAINER-NAME> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment