Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Storing Secrets via ECS Fargate? #686

Closed
araphiel opened this issue Dec 17, 2018 · 4 comments
Closed

[Question] Storing Secrets via ECS Fargate? #686

araphiel opened this issue Dec 17, 2018 · 4 comments

Comments

@araphiel
Copy link

Summary

I'm looking to store secrets in:

  • ecs-params.yml (subnets, security groups, etc)
  • docker-compose.yml (env variables)

What is the defacto way to safely store secrets using ECS Fargate?

@rebyn
Copy link

rebyn commented Dec 18, 2018

The just-released, officially-endorsed way would be AWS Systems Manager Parameter Store. You can find the announcement and links to relevant docos here: https://aws.amazon.com/about-aws/whats-new/2018/12/aws-fargate-platform-version-1-3-adds-secrets-support/.

@allisaurus
Copy link
Contributor

@rebyn that's correct! One additional note for use with the ecs-cli is that we always use the LATEST platform version for Fargate, and this new platform version will be rolling out as acting LATEST through the end of the week. You can find more detail in that article you linked :)

@araphiel the ecs-cli currently supports use of ECS Secrets via the ecs-params.yml (see secrets under services)

@araphiel
Copy link
Author

The timing on this news is amazing!

Thank you @allisaurus @rebyn

@kueben
Copy link

kueben commented Jan 10, 2019

EDIT:
for others who ran into this, it seems secrets manager is not currently supported, whereas SSM parameter store is (which is working with the setup as described below)

Hi, I am attempting to use ecs-params.yml secrets on fargate via ecs-cli. I run into the error: The specified platform does not satisfy the task definition’s required capabilities. as people are saying here aws/amazon-ecs-agent#1209.

@allisaurus @rebyn @araphiel Do you have experience with this working?

I am running the following ecs-cli command:
compose --cluster $ECS_CLUSTER --file docker-compose.staging.yml service up --launch-type FARGATE --timeout 15

Here is my ECS params for reference:

task_definition:
  task_execution_role: ecsTaskExecutionRole
  ecs_network_mode: awsvpc
  task_size:
    mem_limit: 0.5GB
    cpu_limit: 256
  services:
    node:
      secrets:
        - value_from: ${SECRETS_ARN_JWT}
          name: "JWT_TOKEN"
run_params:
  network_configuration:
    awsvpc_configuration:
      subnets:
        - ${ECS_CLUSTER_SUBNET_1}
        - ${ECS_CLUSTER_SUBNET_1}
      security_groups:
        - ${ECS_CLUSTER_SECURITY_GROUP}
      assign_public_ip: ENABLED

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

No branches or pull requests

4 participants