@@ -27,7 +27,7 @@ Metadata:
2727 " amplify" ,
2828 ]
2929 HomePageUrl : https://github.com/aws-samples/cloudfront-authorization-at-edge
30- SemanticVersion : 2.1.2
30+ SemanticVersion : 2.1.3
3131 SourceCodeUrl : https://github.com/aws-samples/cloudfront-authorization-at-edge
3232
3333Parameters :
@@ -150,7 +150,7 @@ Parameters:
150150 Version :
151151 Type : String
152152 Description : " Changing this parameter after initial deployment forces redeployment of Lambda@Edge functions"
153- Default : " 2.1.2 "
153+ Default : " 2.1.3 "
154154 LogLevel :
155155 Type : String
156156 Description : " Use for development: setting to a value other than none turns on logging at that level. Warning! This will log sensitive data, use for development only"
@@ -444,6 +444,7 @@ Resources:
444444 - lambda:UpdateFunctionCode
445445 - lambda:UpdateFunctionConfiguration
446446 - lambda:TagResource
447+ - lambda:ListTags
447448 Resource :
448449 - !Sub " arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*-CheckAuthHandler-*"
449450 - !Sub " arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*-ParseAuthHandler-*"
@@ -754,6 +755,22 @@ Resources:
754755 - !GetAtt UserPool.Arn
755756 - !Ref UserPoolArn
756757
758+ CognitoJwksFetchHandler :
759+ Type : AWS::Serverless::Function
760+ Properties :
761+ CodeUri : src/cfn-custom-resources/fetch-jwks/
762+ Handler : index.handler
763+
764+ FetchedJwks :
765+ Type : Custom::FetchedJwks
766+ Properties :
767+ ServiceToken : !GetAtt CognitoJwksFetchHandler.Arn
768+ Version : !Ref Version
769+ UserPoolArn : !If
770+ - CreateUserPoolAndClient
771+ - !GetAtt UserPool.Arn
772+ - !Ref UserPoolArn
773+
757774 StaticSite :
758775 Type : Custom::StaticSite
759776 Condition : CreateSampleStaticSite
@@ -849,6 +866,7 @@ Resources:
849866 - >
850867 {
851868 "userPoolArn": "${UserPoolArn}",
869+ "jwks": ${FetchedJwks.Jwks},
852870 "clientId": "${ClientId}",
853871 "clientSecret": "${ClientSecret}",
854872 "oauthScopes": ${OAuthScopesJsonArray},
@@ -911,6 +929,7 @@ Resources:
911929 - >
912930 {
913931 "userPoolArn": "${UserPoolArn}",
932+ "jwks": ${FetchedJwks.Jwks},
914933 "clientId": "${ClientId}",
915934 "clientSecret": "${ClientSecret}",
916935 "oauthScopes": ${OAuthScopesJsonArray},
@@ -1005,6 +1024,7 @@ Resources:
10051024 - >
10061025 {
10071026 "userPoolArn": "${UserPoolArn}",
1027+ "jwks": ${FetchedJwks.Jwks},
10081028 "clientId": "${ClientId}",
10091029 "clientSecret": "${ClientSecret}",
10101030 "oauthScopes": ${OAuthScopesJsonArray},
@@ -1067,6 +1087,7 @@ Resources:
10671087 - >
10681088 {
10691089 "userPoolArn": "${UserPoolArn}",
1090+ "jwks": ${FetchedJwks.Jwks},
10701091 "clientId": "${ClientId}",
10711092 "clientSecret": "${ClientSecret}",
10721093 "oauthScopes": ${OAuthScopesJsonArray},
0 commit comments