Slide 17
Slide 17 text
-BNCEB"VUIPSJ[FS࣮
import { ManagedPolicy, Effect, PolicyStatement, Role, ServicePrincipal } from ‘aws-cdk-lib/aws-iam';
// policy ͷ࣮
const authorizerFunctionPolicy = new ManagedPolicy(this, "authorizer-function-policy", {
managedPolicyName: "authorizer-function-policy",
statements: [
new PolicyStatement({
effect: Effect.ALLOW,
actions: [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
],
resources: ["arn:aws:logs:*:*:*"],
}),
]
});
const authorizerFunctionRole = new Role(this, "authorizer-function-role", {
roleName: "authorizer-function-role",
assumedBy: new ServicePrincipal("lambda.amazonaws.com"),
managedPolicies: [authorizerFunctionPolicy]
});