incorrect IAM Service Principal for Lambda in China regions
See original GitHub issueHello,
The recent release includes support for IAM service principles for China regions. I did some tests using the CDK example repo. The Classic Load Balancer and Application Load Balancer examples worked without any issue. But when I tried custom-resource example, the deployment failed. Below is the error message:
Invalid principal in policy: “SERVICE”:“lambda.amazonaws.com.cn”
I found out that the correct IAM service principal for Lambda in China regions is ‘lambda.amazonaws.com’。
daf7d4f7304ee111e89c2dfa7ae01bbebcServiceRoleFE9ABB04) Invalid principal in policy: "SERVICE":"lambda.amazonaws.com.cn" (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID: 4f413759-59fe-11e9-a3f0-1926a8616aab)
new Role (/Users/sunhua/Documents/Projects/github.com/aws-samples/aws-cdk-examples/typescript/custom-resource/node_modules/@aws-cdk/aws-iam/lib/role.js:24:22)
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
incorrect IAM Service Principal for Lambda in AWS China ...
Hello, I have tested FunctionBeat in AWS China region with those errors: 2020-03-31T12:13:10.748+0800 INFO [aws] aws/op_cloudformation.go:97 ...
Read more >Amazon JSON policy elements: Principal - 亚马逊云科技
Use the Principal element in a resource-based JSON policy to specify the principal that is allowed or denied access to a resource.
Read more >"Invalid principal" error for unsupported AWS regions
New Relic can obtain monitoring data from services and endpoints that are located in all AWS regions except from China regions. You will...
Read more >class ServicePrincipal · AWS CDK
An IAM principal that represents an AWS service (i.e. sqs.amazonaws.com). Example. const lambdaRole = new iam.Role(this, 'Role' ...
Read more >Resolve "Invalid principal in policy" error in Amazon S3
If your S3 bucket is in an AWS Region that isn't enabled by default, confirm that the IAM principal's account has the AWS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@EthanGao-oss Good news! I managed to get the overriding working!
You can find the code in this gist.
I will send a PR to fix @aws-cdk/region-info package.
Great work👍. Already tried release v1.5.0, the service principal problem is gone.
Harold Sun notifications@github.com 于2019年8月25日周日 上午10:54写道: