-
-
Save eraclitux/519421f0ffcfb751e5f606484f33ff19 to your computer and use it in GitHub Desktop.
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: AWS resources for an ECS application. | |
Parameters: | |
ImageVersion: | |
Description: Image version to deploy | |
Type: String | |
Resources: | |
CloudwatchLogsGroup: | |
Type: AWS::Logs::LogGroup | |
Properties: | |
LogGroupName: my-containers-logs | |
RetentionInDays: 7 | |
MyTask: | |
Type: AWS::ECS::TaskDefinition | |
Properties: | |
Family: my-application | |
ContainerDefinitions: | |
- Name: application-main | |
MemoryReservation: 32 | |
Essential: true | |
Image: !Sub '${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/<my-repo>:application-main-${ImageVersion}' | |
LogConfiguration: | |
LogDriver: awslogs | |
Options: | |
awslogs-group: !Ref CloudwatchLogsGroup | |
awslogs-region: !Ref 'AWS::Region' | |
awslogs-stream-prefix: my-application-container | |
MyService: | |
Type: AWS::ECS::Service | |
Properties: | |
Cluster: !Sub 'arn:aws:ecs:${AWS::Region}:${AWS::AccountId}:cluster/<my-cluster>' | |
DesiredCount: 2 | |
TaskDefinition: !Ref MyTask |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment