-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-ssmRelated to AWS Systems ManagerRelated to AWS Systems Managerfeature-requestA feature should be added or improved.A feature should be added or improved.feature/enhancementA new API to make things easier or more intuitive. A catch-all for general feature requests.A new API to make things easier or more intuitive. A catch-all for general feature requests.needs-cfnThis issue is waiting on changes to CloudFormation before it can be addressed.This issue is waiting on changes to CloudFormation before it can be addressed.
Description
General Issue
Ability to retrieve secure string without version number
The Question
I am using ECS fargate and the secrets property to retrieve secret env vars from SSM.
new ApplicationLoadBalancedFargateService(this, "ECSService", {
taskImageOptions: {
secrets: {
API_KEY: this.getSecret("API_KEY", 1),
},
},
});
private getSecret(parameterName: string, version: number): ecs.Secret {
return ecs.Secret.fromSsmParameter(
ssm.StringParameter.fromSecureStringParameterAttributes(this, `SecretParameter-${parameterName}`, { parameterName, version })
);
}
The problem is you have to define the version number to retrieve a secure string (unlike a regular string) and this gets difficult when you deploy the same stack to different environments and the version of the secret may differ between environments.
Is there a better way of doing this or can I suggest this as a new feature request? It's not clear why you don't have to define a version for a regular string but you do for a secure one...
CDK CLI Version
1.107.0
Framework Version
No response
Node.js Version
12
OS
No response
Language
Typescript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ssmRelated to AWS Systems ManagerRelated to AWS Systems Managerfeature-requestA feature should be added or improved.A feature should be added or improved.feature/enhancementA new API to make things easier or more intuitive. A catch-all for general feature requests.A new API to make things easier or more intuitive. A catch-all for general feature requests.needs-cfnThis issue is waiting on changes to CloudFormation before it can be addressed.This issue is waiting on changes to CloudFormation before it can be addressed.