Paulo
02/12/2021, 8:27 AMPaulo
02/12/2021, 8:38 AMCan't you just encrypt the data "at rest" in dynamo or s3 with an encryption key stored in secrets manager?@Stoyan Georgiev replying here to not pollute the main thread. I think I could, but it also doesn't sound like the best approach. I mean secrets manager are supposed to be used for that, isn't it? Using S3 or dynamoDB to store the data seems hacky, but maybe it's the only way. I don't know
Pål Brattberg
02/12/2021, 8:41 AMaws ssm --region ${region} put-parameter --overwrite --cli-input-json '{"Name": "/myapp/${stage}${secret[0]}", "Value": "${secret[1]}", "Type": "String"}'
Stoyan Georgiev
02/12/2021, 8:42 AMPål Brattberg
02/12/2021, 8:43 AMPaulo
02/12/2021, 9:14 AMSecretString
from SecretsManager in CDK
Thanks!Stoyan Georgiev
02/12/2021, 9:17 AMPaulo
02/12/2021, 9:24 AMRoss Coundon
02/12/2021, 10:33 AMconst params = {
Name: paramName,
WithDecryption: true,
};
return await ssm.getParameter(params).promise();
You just need to make sure that your lambda role has access to the parameter and to the key for decryptPaulo
02/13/2021, 9:42 AMYou can create eitherFrom what I understood they don't allow to create secret values in CDK (for both SSM or SecretsManager) for security reasons, to avoid some leaking in stack creation logs or somewhere else. Based on that, I think @Pål Brattberg's strategy of having a separate script sounds like a good way to handle it. I will try to do the following: • script to create/edit the secrets before running sst build • in my cdk stack I import the secrets and export the ARNs • in my lambdas I use the secret ARN to get the value sounds sane?or `ssm.StringListParameter`s in a CDK app. These are public (not secret) values. Parameters of type SecretString cannot be created directly from a CDK application; if you want to provision secrets automatically, use Secrets Manager Secrets (see thessm.StringParameter
package).@aws-cdk/aws-secretsmanager