Drew
11/16/2021, 11:57 PMFrank
Creating SSM in stackA:
const paramInStackA = new ssm.StringParameter(this, "Param", {
stringValue: "Foo",
});
Consuming SSM in stackB:
ssm.StringParameter.valueForStringParameter(this, paramInStackA.parameterName);
Generating specific IAM permissions for ARNs created in other stack?Say u want to grant the Lambda functions in stackB the permission to fetch the SSM params created in stackA. Do this in stackB:
fnInStackB.attachPermissions([
new iam.PolicyStatement({
actions: ["..."],
effect: iam.Effect.ALLOW,
resources: [
paramInStackA.parameterArn,
],
}),
]);
Frank
Drew
11/17/2021, 5:29 AMDrew
11/17/2021, 5:30 AMDrew
11/17/2021, 5:30 AMMike McCall
11/17/2021, 6:08 AMappEventBus.*grantPutEventsTo*(lambdaFn)
Accessing CDK resource from SST class
sessionTable.dynamodbTable.*grantReadData*(lambdaFn)
Derek Kershner
11/17/2021, 8:46 PMI’m hopeful that this pattern won’t be as brittle.It definitely isnt. The handing of things between stacks using class variables uses Cfn Exports, which are quite brittle. SSM and such are much more decoupled. Still order dependent, but Cfn wont trip you up nearly as much.