Michael Wolfenden
04/15/2021, 4:10 AM- Effect: 'Allow'
Action:
- 'execute-api:Invoke'
Resource:
Fn::Join:
- ''
- - 'arn:aws:execute-api:'
- Ref: AWS::Region
- ':'
- Ref: AWS::AccountId
- ':'
- Ref: ApiGatewayRestApi
- '/*'
What would be the equivalent in cdk given I have a api = new sst.Api
this.role.addToPolicy(
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['execute-api:Invoke'],
resources: [api.httpApi.???],
}),
)
Frank
const resourceArn = Stack.of(this).formatArn({
service: "execute-api",
resourceName: `*`,
resource: api.httpApi.httpApiId,
});
and then
resources: [resourceArn],
Frank
sst.Auth
to create the Identity Pool, you can just do:
const auth = sst.Auth(...);
auth.attachPermissionsForAuthUsers([api]);
Frank