Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2021
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.38 KB | None | 0 0
  1. {
  2.   "Parameters": {
  3.     "SUBNET": {
  4.       "Type": "AWS::EC2::Subnet::Id"
  5.     },
  6.     "FSPROMCONFIG": {
  7.       "Type": "String"
  8.     },
  9.     "EXECROLE": {
  10.       "Type": "String"
  11.     }
  12.   },
  13.   "Resources": {
  14.     "cluster": {
  15.       "Type": "AWS::ECS::Cluster",
  16.       "Properties": {
  17.         "ClusterName": "test"
  18.       }
  19.     },
  20.     "task": {
  21.       "Type": "AWS::ECS::TaskDefinition",
  22.       "DependsOn": [
  23.         "fspromdata",
  24.         "appromdata"
  25.       ],
  26.       "Properties": {
  27.         "ContainerDefinitions": [
  28.           {
  29.             "Name": "prometheus",
  30.             "Image": "prom/prometheus",
  31.             "PortMappings": [
  32.               {
  33.                 "ContainerPort": 9090,
  34.                 "HostPort": 9090,
  35.                 "Protocol": "tcp"
  36.               }
  37.             ],
  38.             "MountPoints": [
  39.               {
  40.                 "SourceVolume": "prom-storage",
  41.                 "ContainerPath": "/prometheus",
  42.                 "ReadOnly": false
  43.               },
  44.               {
  45.                 "SourceVolume": "prom-config",
  46.                 "ContainerPath": "/etc/prometheus",
  47.                 "ReadOnly": true
  48.               }
  49.             ],
  50.             "LogConfiguration": {
  51.               "LogDriver": "awslogs",
  52.               "Options": {
  53.                 "awslogs-group": "test",
  54.                 "awslogs-region": "eu-west-2",
  55.                 "awslogs-create-group": "true",
  56.                 "awslogs-stream-prefix": "prometheus"
  57.               }
  58.             }
  59.           }
  60.         ],
  61.         "Volumes": [
  62.           {
  63.             "Name": "prom-storage",
  64.             "EFSVolumeConfiguration": {
  65.               "FilesystemId": {
  66.                 "Ref": "fspromdata"
  67.               },
  68.               "TransitEncryption": "ENABLED",
  69.               "AuthorizationConfig": {
  70.                 "AccessPointId": {
  71.                   "Ref": "appromdata"
  72.                 }
  73.               }
  74.             }
  75.           },
  76.           {
  77.           "Name": "prom-config",
  78.           "EFSVolumeConfiguration": {
  79.             "FilesystemId": {
  80.               "Ref": "FSPROMCONFIG"
  81.             }
  82.           }
  83.         }
  84.       ],
  85.       "Cpu": "256",
  86.       "Memory": "512",
  87.       "Family": "test",
  88.       "NetworkMode": "awsvpc",
  89.       "ExecutionRoleArn": {
  90.         "Ref": "EXECROLE"
  91.       },
  92.       "RequiresCompatibilities": [
  93.         "FARGATE"
  94.       ]
  95.     }
  96.   },
  97.   "service": {
  98.     "Type": "AWS::ECS::Service",
  99.     "Properties": {
  100.       "TaskDefinition": {
  101.         "Ref": "task"
  102.       },
  103.       "Cluster": {
  104.         "Ref": "cluster"
  105.       },
  106.       "DesiredCount": 1,
  107.       "LaunchType": "FARGATE",
  108.       "NetworkConfiguration": {
  109.         "AwsvpcConfiguration": {
  110.           "AssignPublicIp": "ENABLED",
  111.           "Subnets": [
  112.             {
  113.               "Ref": "SUBNET"
  114.             }
  115.           ]
  116.         }
  117.       }
  118.     }
  119.   },
  120.   "fspromdata": {
  121.     "Type": "AWS::EFS::FileSystem",
  122.     "Properties": {
  123.       "AvailabilityZoneName": "eu-west-2a",
  124.       "Encrypted": true
  125.     }
  126.   },
  127.   "appromdata": {
  128.     "Type": "AWS::EFS::AccessPoint",
  129.     "Properties": {
  130.       "FileSystemId": {
  131.         "Ref": "fspromdata"
  132.       },
  133.       "PosixUser": {
  134.         "Uid": "1001",
  135.         "Gid": "0"
  136.       },
  137.       "RootDirectory": {
  138.         "CreationInfo": {
  139.           "OwnerGid": "0",
  140.           "OwnerUid": "1001",
  141.           "Permissions": "0755"
  142.         }
  143.       }
  144.     }
  145.   }
  146. }
  147. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement