-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Support Secret with partial Arn #7994
Labels
@aws-cdk/aws-secretsmanager
Related to AWS Secrets Manager
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p1
Comments
tuler
added
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
labels
May 15, 2020
Related: #7444, #6889 (comment) |
skinny85
added
effort/small
Small work item – less than a day of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jun 29, 2020
njlynch
added a commit
that referenced
this issue
Sep 11, 2020
Adds the ability to import secrets by name, including without the SecretsManager assigned suffix. As long as a secret with the same name has been created in each region with the same name, this allows for the same `fromSecretName` usage in stacks across regions. Oddly enough, most CloudFormation templates that take references to secrets accept either the full-form ARN, including the suffix or just the base secret name (not in ARN format). The one place where a full ARN format is needed is in IAM policy statements, where the wildcard is necessary to account for the suffix. Tested this manually against an existing secret with a CodeBuild project; per the CloudFormation docs, this should work equally well with other SecretsManager-integrated services. fixes #7444 fixes #7949 fixes #7994
njlynch
added a commit
that referenced
this issue
Sep 11, 2020
Adds the ability to import secrets by name, including without the SecretsManager assigned suffix. As long as a secret with the same name has been created in each region with the same name, this allows for the same `fromSecretName` usage in stacks across regions. Oddly enough, most CloudFormation templates that take references to secrets accept either the full-form ARN, including the suffix or just the base secret name (not in ARN format). The one place where a full ARN format is needed is in IAM policy statements, where the wildcard is necessary to account for the suffix. Tested this manually against an existing secret with a CodeBuild project; per the CloudFormation docs, this should work equally well with other SecretsManager-integrated services. fixes #7444 fixes #7949 fixes #7994
njlynch
added a commit
that referenced
this issue
Sep 14, 2020
Adds the ability to import secrets by name, including without the SecretsManager assigned suffix. As long as a secret with the same name has been created in each region with the same name, this allows for the same `fromSecretName` usage in stacks across regions. Oddly enough, most CloudFormation templates that take references to secrets accept either the full-form ARN, including the suffix or just the base secret name (not in ARN format). The one place where a full ARN format is needed is in IAM policy statements, where the wildcard is necessary to account for the suffix. Tested this manually against an existing secret with a CodeBuild project; per the CloudFormation docs, this should work equally well with other SecretsManager-integrated services. fixes #7444 fixes #7949 fixes #7994
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-secretsmanager
Related to AWS Secrets Manager
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p1
When a container in a
TaskDefinition
uses a secret, it automatically adds to the taskDefinition generatedExecutionRole
the IAM permission to read the secret value.If the secret is imported from an existing resource, by using
secretsmanager.Secret.fromSecretAttributes
orsecretsmanager.Secret.fromSecretArn
the Arn can be an partial Arn, without the-
and 6 random chars AWS appends to the friendly name.The problem is that Secret.grantRead gives permission to the exact Arn only, so the task fails to execute.
Use Case
It's common to use partial Arn when using secrets, because they represent friendly names.
Proposed Solution
I tried to manually add a more relaxed policy to the taskDefinition execution role, but it did not work.
I don't know why it did not work, or if this is the best approach.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: