Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Resources:
- Repository:
- Type: AWS::ECR::Repository
- Properties:
- RepositoryName: paas-monitor
- ExecutionRole:
- Type: AWS::IAM::Role
- Properties:
- AssumeRolePolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Principal:
- Service:
- - ecs-tasks.amazonaws.com
- Action:
- - 'sts:AssumeRole'
- ManagedPolicyArns:
- - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
- Cluster:
- Type: AWS::ECS::Cluster
- Properties:
- ClusterName: awslabs-cluster
- TaskDefinition:
- Type: AWS::ECS::TaskDefinition
- Properties:
- Family: 'paas-monitor'
- Cpu: 256
- Memory: 512
- NetworkMode: 'awsvpc'
- RequiresCompatibilities:
- - FARGATE
- ContainerDefinitions:
- - Name: 'paas-monitor'
- Image: !Sub '${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}:latest'
- Cpu: 256
- Memory: 512
- PortMappings:
- - ContainerPort: 1337
- HostPort: 1337
- ExecutionRoleArn: !Ref ExecutionRole
- SecurityGroup:
- Type: AWS::EC2::SecurityGroup
- Properties:
- VpcId: vpc-0b3f586ef04a0cf57
- GroupDescription: 'public access to paas-monitor'
- SecurityGroupIngress:
- - Description: 'open to the world'
- FromPort: 1337
- ToPort: 1337
- IpProtocol: 'tcp'
- CidrIp: '0.0.0.0/0'
- Service:
- Type: AWS::ECS::Service
- Properties:
- Cluster: !Ref Cluster
- ServiceName: 'paas-monitor'
- TaskDefinition: !Ref 'TaskDefinition'
- DesiredCount: 1
- LaunchType: 'FARGATE'
- NetworkConfiguration:
- AwsvpcConfiguration:
- Subnets:
- - subnet-019f45ae5d764862e
- - subnet-0acf5eef5c3a9e812
- - subnet-0300609d63deee18e
- SecurityGroups:
- - !Ref SecurityGroup
- AssignPublicIp: 'ENABLED'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement