-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: KeyError: u'AWS_IAM' and add typing #2604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1ed9f16
Fix AWS_IAM KeyError Exception
GavinZZ e8326ca
Merge branch 'develop' into aws_iam_key_error_fix
aahung c3439bd
Add unit test to cover this missing case
GavinZZ 5fcfc67
Merge branch 'develop' into aws_iam_key_error_fix
hoffa 5213ea2
Merge branch 'develop' into aws_iam_key_error_fix
hoffa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
tests/translator/input/api_http_with_default_iam_authorizer.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
Resources: | ||
HelloWorldFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: app.lambda_handler | ||
Runtime: python3.8 | ||
Role: | ||
Fn::GetAtt: | ||
- HelloWorldFunctionRole | ||
- Arn | ||
Architectures: | ||
- x86_64 | ||
Events: | ||
HelloWorld: | ||
Type: HttpApi | ||
Properties: | ||
ApiId: | ||
Ref: HttpApi | ||
Path: /{proxy+} | ||
Method: ANY | ||
Preflight: | ||
Type: HttpApi | ||
Properties: | ||
ApiId: | ||
Ref: HttpApi | ||
Path: /{proxy+} | ||
Method: OPTIONS | ||
HelloWorldFunctionRole: | ||
Type: AWS::IAM::Role | ||
Properties: | ||
AssumeRolePolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Principal: | ||
Service: lambda.amazonaws.com | ||
Action: sts:AssumeRole | ||
Policies: | ||
- PolicyName: HelloWorldFunctionPolicy | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- logs:CreateLogGroup | ||
- logs:CreateLogStream | ||
- logs:PutLogEvents | ||
- cognito-idp:List* | ||
- cognito-idp:AdminListGroupsForUser | ||
- sts:AssumeRole | ||
Resource: '*' | ||
Metadata: | ||
SamResourceId: HelloWorldFunctionRole | ||
|
||
HttpApi: | ||
Type: AWS::Serverless::HttpApi | ||
Properties: | ||
StageName: | ||
Fn::Sub: ${StageName} | ||
DefinitionBody: | ||
openapi: 3.0.1 | ||
info: | ||
title: | ||
Ref: AWS::StackName | ||
paths: {} | ||
CorsConfiguration: | ||
AllowOrigins: | ||
- '*' | ||
AllowCredentials: false | ||
AllowHeaders: | ||
- Content-Type | ||
- X-CSRF-TOKEN | ||
- X-Amz-Date | ||
- Authorization | ||
- X-Requested-With | ||
- X-Requested-By | ||
- X-Api-Key | ||
- X-Forwarded-For | ||
- X-Amz-Security-Token | ||
AllowMethods: | ||
- '*' | ||
Auth: | ||
EnableIamAuthorizer: true | ||
DefaultAuthorizer: AWS_IAM | ||
Authorizers: | ||
MyAuthorizer: | ||
IdentitySource: $request.header.Authorization | ||
JwtConfiguration: | ||
audience: | ||
- Ref: UserPoolClient | ||
- Ref: UserPoolClientApp | ||
issuer: | ||
Fn::Join: | ||
- '' | ||
- - https://cognito-idp. | ||
- Fn::Sub: ${AWS::Region} | ||
- .amazonaws.com/ | ||
- Ref: UserPool | ||
Metadata: | ||
SamResourceId: HttpApi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.