cdk-ssm-secure-iam-access-key
v0.0.8
Published
Creates an IAM Access Key for a provided IAM User and stores the result in an SSM SecureString Parameter
Downloads
9,244
Maintainers
Readme
cdk-ssm-secure-iam-access-key
Creates an IAM Access Key for a provided IAM User and stores the result in an SSM SecureString Parameter
Installation
npm i -D cdk-ssm-secure-iam-access-key
Usage
const user = new iam.User(this, "SMTPUser");
user.addToPolicy(
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ["ses:SendRawEmail"],
resources: ["*"],
})
);
new SSMSecureIAMAccessKey(this, "SMTPUserCredentials", {
parameterName: "/smtpCredentials",
user,
});
// JSON.stringified {accessKeyId: "...", secretAccessKey: "..."}
return ssm.StringParameter.fromSecureStringParameterAttributes(
this,
"SMTPUserCredentialsSSM",
{
parameterName: "/smtpCredentials",
}
);