Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "Parameters": {
- "SUBNET": {
- "Type": "AWS::EC2::Subnet::Id"
- },
- "FSPROMCONFIG": {
- "Type": "String"
- },
- "EXECROLE": {
- "Type": "String"
- }
- },
- "Resources": {
- "cluster": {
- "Type": "AWS::ECS::Cluster",
- "Properties": {
- "ClusterName": "test"
- }
- },
- "task": {
- "Type": "AWS::ECS::TaskDefinition",
- "DependsOn": [
- "fspromdata",
- "appromdata"
- ],
- "Properties": {
- "ContainerDefinitions": [
- {
- "Name": "prometheus",
- "Image": "prom/prometheus",
- "PortMappings": [
- {
- "ContainerPort": 9090,
- "HostPort": 9090,
- "Protocol": "tcp"
- }
- ],
- "MountPoints": [
- {
- "SourceVolume": "prom-storage",
- "ContainerPath": "/prometheus",
- "ReadOnly": false
- },
- {
- "SourceVolume": "prom-config",
- "ContainerPath": "/etc/prometheus",
- "ReadOnly": true
- }
- ],
- "LogConfiguration": {
- "LogDriver": "awslogs",
- "Options": {
- "awslogs-group": "test",
- "awslogs-region": "eu-west-2",
- "awslogs-create-group": "true",
- "awslogs-stream-prefix": "prometheus"
- }
- }
- }
- ],
- "Volumes": [
- {
- "Name": "prom-storage",
- "EFSVolumeConfiguration": {
- "FilesystemId": {
- "Ref": "fspromdata"
- },
- "TransitEncryption": "ENABLED",
- "AuthorizationConfig": {
- "AccessPointId": {
- "Ref": "appromdata"
- }
- }
- }
- },
- {
- "Name": "prom-config",
- "EFSVolumeConfiguration": {
- "FilesystemId": {
- "Ref": "FSPROMCONFIG"
- }
- }
- }
- ],
- "Cpu": "256",
- "Memory": "512",
- "Family": "test",
- "NetworkMode": "awsvpc",
- "ExecutionRoleArn": {
- "Ref": "EXECROLE"
- },
- "RequiresCompatibilities": [
- "FARGATE"
- ]
- }
- },
- "service": {
- "Type": "AWS::ECS::Service",
- "Properties": {
- "TaskDefinition": {
- "Ref": "task"
- },
- "Cluster": {
- "Ref": "cluster"
- },
- "DesiredCount": 1,
- "LaunchType": "FARGATE",
- "NetworkConfiguration": {
- "AwsvpcConfiguration": {
- "AssignPublicIp": "ENABLED",
- "Subnets": [
- {
- "Ref": "SUBNET"
- }
- ]
- }
- }
- }
- },
- "fspromdata": {
- "Type": "AWS::EFS::FileSystem",
- "Properties": {
- "AvailabilityZoneName": "eu-west-2a",
- "Encrypted": true
- }
- },
- "appromdata": {
- "Type": "AWS::EFS::AccessPoint",
- "Properties": {
- "FileSystemId": {
- "Ref": "fspromdata"
- },
- "PosixUser": {
- "Uid": "1001",
- "Gid": "0"
- },
- "RootDirectory": {
- "CreationInfo": {
- "OwnerGid": "0",
- "OwnerUid": "1001",
- "Permissions": "0755"
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement