Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

[Enhancement] [ECS] Environment variables "valueFrom" AWS Parameter Store and Secret Manager #2200

Open
os1ma opened this issue Nov 14, 2022 · 1 comment

Comments

@os1ma
Copy link

os1ma commented Nov 14, 2022

Description

Thanks for providing a great tool! I have a small proposal. AWS ECS allows environment variables to be set from AWS Systems Manager Parameter Store or AWS Secrets Manager with "valueFrom". This ECS support for compose does not seem to have a setting for this feature. It would be nice to be able to configure like following in the same way as x-aws-role.

services:
  foo:
    x-aws-secrets:
      - name: ENV_VAR_NAME
        value_from: parameter-name or ARN

I found in the documentation here that we can use AWS Secret Manager to set a secret on a file. However, it would be more convenient if we could easily set values for environment variables as described above.

Additional information you deem important (e.g. issue happens only occasionally):

I also considered a workaround to override the task definition using x-aws-cloudformation, but it was not practical. I tried to write the following configuration and convert it.

services:
  web:
    image: nginx:alpine
    ports:
      - '80:80'

x-aws-cloudformation:
  Resources:
    WebTaskDefinition:
      Properties:
        ContainerDefinitions:
          - Name: web
            Secrets:
              - Name: ENV_VAR_NAME
                ValueFrom: my-parameter

Then I got the following output, and the original ContainerDefinitions disappeared.

  WebTaskDefinition:
    Properties:
      ContainerDefinitions:
        - Name: web
          Secrets:
            - Name: ENV_VAR_NAME
              ValueFrom: my-parameter

It may be sufficient if Secrets can be set using x-aws-cloudformation without adding a configuration like x-aws-secrets. This could be solved with an implementation for #2160 .

Additional environment details (AWS ECS, Azure ACI, local, etc.):

AWS ECS

@stale
Copy link

stale bot commented May 22, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant