@aws-cdk/aws-iam:standardizedServicePrincipals: produces invalid templates when using some L2 constructs #23066
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
bug
This issue is a bug.
duplicate
This issue is a duplicate.
Describe the bug
When enabling the feature flag @aws-cdk/aws-iam:standardizedServicePrincipals and using the L2 construct for AppSync "AppsyncFunction", the synthesized template is invalid.
Expected Behavior
The produced assume role policy is valid
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync.amazonaws.com"
}
}
Current Behavior
An invalid assume role policy is produced
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
}
}
As "Service": "appsync" is not a valid principal.
Reproduction Steps
Enable the feature flag @aws-cdk/aws-iam:standardizedServicePrincipals
Create a new AppsyncFunction
npx cdk synth
npx cdk deploy <stack_name>
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.51.1
Framework Version
No response
Node.js Version
16.18
OS
OSx, AmazonLinux2
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: