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

[aws-ecs] Allow for field prop in ecs.Secret.fromSecretsManager for Fargate launch type #10733

Closed
2 tasks
jpSimkins opened this issue Oct 6, 2020 · 7 comments
Closed
2 tasks
Assignees
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@jpSimkins
Copy link

Allow for using field values for ecs.Secret.fromSecretsManager(cdkTestSecret), for the Fargate launch type.

Currently, if you try to use the field prop, you will see this message:

Cannot specify secret JSON field for a task using the FARGATE launch type: 'DB_PASSWORD' in container '...'

Use Case

Our systems are already designed to use ENV Vars, this limitation means we need to modify the systems now to parse the json and build a way to add this into the ENV vars. Although, once inside the app, this is not as secure.

e.g. in PHP you can disable the $_ENV super global and force the usage of getenv. I cannot do this with the current limitation and this would expose the secrets to the $_ENV super global. This is not ideal but it's the fastest solution I can do to not break existing system.

Proposed Solution

Please allow the use of field from the secrets manager for Fargate launch types

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@jpSimkins jpSimkins added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 6, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Oct 6, 2020
@jogold
Copy link
Contributor

jogold commented Oct 7, 2020

Unfortunately this is currently not supported by ECS for tasks that use the Fargate launch type: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html

For tasks that use the Fargate launch type, the following should be considered:

  • It is only supported to inject the full contents of a secret as an environment variable. Specifying a specific JSON key or version is not supported at this time.

@jpSimkins
Copy link
Author

jpSimkins commented Oct 8, 2020

This is why this ticket is a feature request ;) Ideally, if there are enough up votes then this may possible. I get that this is a limitation with ECS currently but that doesn't mean that this feature request is not warranted.

I have numerous projects that will have to be refactored a bit to get this to work and I think that this limitation should be considered for review. Either way, I am going to have to refactor but this is not ideal for the long haul.

@jogold
Copy link
Contributor

jogold commented Oct 8, 2020

FYI this is currently tracked here aws/containers-roadmap#385

@jpSimkins
Copy link
Author

@jogold Thank you!

@github-actions
Copy link

github-actions bot commented Oct 9, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@marcotesch
Copy link
Contributor

This is now Possible can we make that feature available?

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html

image

@jogold
Copy link
Contributor

jogold commented Nov 12, 2020

See #11348 + workaround here #11341 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants