Skip to content

[OLD] Configuration with Environment Variables and Secrets

Komalis edited this page Apr 10, 2025 · 1 revision

This is the old format, it is still usable, but I would advice to use : https://github.com/Komalis/easyecs/wiki/Configuration-with-Environment-Variables-and-Secrets-v2

metadata:
  appname: "helloworld"
role:
  managed_policies: []
  statements:
    - sid: "ssmactions"
      resources: ["*"]
      actions: ["ssmmessages:CreateControlChannel", "ssmmessages:CreateDataChannel", "ssmmessages:OpenControlChannel", "ssmmessages:OpenDataChannel", "secretsmanager:*"]
      effect: "Allow"
execution_role:
  managed_policies: ["service-role/AmazonECSTaskExecutionRolePolicy", "AmazonEC2ContainerRegistryReadOnly"]
  statements:
    - sid: "secretmanageractions"
      resources: ["*"]
      actions: ["secretsmanager:GetSecretValue"]
      effect: "Allow"
    - sid: "s3actions"
      resources: ["*"]
      actions: ["s3:*"]
      effect: "Allow"
task_definition:
  resources:
    limits:
      cpu: 2
      memory: 4096
  containers:
    - name: helloworld
      image: docker.io/library/debian
      user: root
      tty: true
      command: "/bin/bash"
      resources:
        limits:
          cpu: 1
          memory: 2048
      env:
        - name: "testenv"
          value: "testenv"
        - name: "testenv_notactive"
          value: "testenv_notactive"
          active: false
      secrets:
        - name: "testsecret"
          arn: "arnfromsecretmanagerwith5digitsattheend"
          field: "fieldofthesecrettouse"

Clone this wiki locally