Patrick Michallet
03/07/2022, 3:32 PMarn:aws:sts::{id}:assumed-role/dev-{application-name}-ApiLambdaGET{endpointName}/*
) and obviously it’s not feasible for me to add all of these to atlas.
So I think the resulting question I’ve got is: Is there a way to create and specify one role for all functions in an API? And if not, do you have any recommended patterns for passwordless authentication with atlas using Lambda’s IAM credentials?thdxr
03/07/2022, 3:33 PMPatrick Michallet
03/07/2022, 3:36 PMthdxr
03/07/2022, 3:46 PMthdxr
03/07/2022, 3:46 PMthdxr
03/07/2022, 3:47 PMFrank
import * as iam from "aws-cdk-lib/aws-iam";
const role = new iam.Role(this, "Role", {
assumedBy: new iam.ServicePrincipal("<http://lambda.amazonaws.com|lambda.amazonaws.com>"),
...,
});
new sst.Api(this, "Api", {
defaultFunctionProps: {
role,
},
routes: {
...
},
});
Frank
Patrick Michallet
03/07/2022, 9:16 PMmanagedPolicies: [{ managedPolicyArn: 'arn:aws:iam::aws:policy/service-role/AWSLambdaSQSQueueExecutionRole'}]