Skip to content

Commit daaf0aa

Browse files
authored
feat(cdk): expose authorizer id and authorization type (#31622)
### Issue # (if applicable) Closes #31605. ### Reason for this change I need to access the authorizer id and type to be able to import the authorizer in another CDK project ### Description of changes I have added a public readonly variable for the authorizationType that was previously a string in the return object from the bind function. I have also added a getter that will return the authorizerId after the first binding. If not bound yet it will throw an error. ### Description of how you validated changes I have added unit tests for all changed files. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 0a56c0d commit daaf0aa

File tree

35 files changed

+420
-166
lines changed

35 files changed

+420
-166
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/AuthorizerInteg.assets.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/AuthorizerInteg.template.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"S3Bucket": {
3939
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
4040
},
41-
"S3Key": "d7d3785243d748927f2a8d6edcecf909f96191df27a815e305aaeba98bcd2c64.zip"
41+
"S3Key": "9b3143f6d2fe3103f2f3162c221163ad6a5a0ba2219cc1e5af2e300325588714.zip"
4242
},
4343
"Handler": "index.handler",
4444
"Role": {
@@ -360,7 +360,7 @@
360360
"S3Bucket": {
361361
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
362362
},
363-
"S3Key": "54deaef2af5b9afbfc9cbcbb9261b1c0d4cce6560831d7ae1959f3da899011c8.zip"
363+
"S3Key": "0793b3c94d0be9d628975dbbcd1dc523196de50a41fb1920880248ae3c24259b.zip"
364364
},
365365
"Handler": "index.handler",
366366
"Role": {
@@ -497,6 +497,14 @@
497497
]
498498
]
499499
}
500+
},
501+
"AuthorizerId": {
502+
"Value": {
503+
"Ref": "MyHttpApiLambdaAuthorizerB8A0E2A4"
504+
}
505+
},
506+
"AuthorizationType": {
507+
"Value": "CUSTOM"
500508
}
501509
},
502510
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.0793b3c94d0be9d628975dbbcd1dc523196de50a41fb1920880248ae3c24259b.handler/index.js

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.54deaef2af5b9afbfc9cbcbb9261b1c0d4cce6560831d7ae1959f3da899011c8.handler/index.d.ts

-7
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.54deaef2af5b9afbfc9cbcbb9261b1c0d4cce6560831d7ae1959f3da899011c8.handler/index.js

-14
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.54deaef2af5b9afbfc9cbcbb9261b1c0d4cce6560831d7ae1959f3da899011c8.handler/index.ts

-9
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.9b3143f6d2fe3103f2f3162c221163ad6a5a0ba2219cc1e5af2e300325588714/index.js

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.d7d3785243d748927f2a8d6edcecf909f96191df27a815e305aaeba98bcd2c64/index.d.ts

-3
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.d7d3785243d748927f2a8d6edcecf909f96191df27a815e305aaeba98bcd2c64/index.js

-12
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/asset.d7d3785243d748927f2a8d6edcecf909f96191df27a815e305aaeba98bcd2c64/index.ts

-9
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/integ.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/manifest.json

+15-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.js.snapshot/tree.json

+29-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.lambda.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,10 @@ new CfnOutput(stack, 'URL', {
6262
});
6363
new CfnOutput(stack, 'URLWithDefaultAuthorizer', {
6464
value: httpApiWithDefaultAuthorizer.url!,
65-
});
65+
});
66+
new CfnOutput(stack, 'AuthorizerId', {
67+
value: authorizer.authorizerId,
68+
});
69+
new CfnOutput(stack, 'AuthorizationType', {
70+
value: authorizer.authorizationType,
71+
});

0 commit comments

Comments
 (0)