From ebbc9077bdddb946efda868f9bc2dda4fef500fa Mon Sep 17 00:00:00 2001 From: GZ Date: Thu, 6 Jun 2024 12:57:36 -0700 Subject: [PATCH] chore(apigatewayv2): add apigatewayv2 integrations and authorizers to jsiirc (#30461) ### Issue # (if applicable) Closes https://github.com/aws/aws-cdk/issues/28348 ### Reason for this change When we promote apigatewayv2 from experimental to stable module, we did not add `jsiirc.json` file, thus no documentation is created and the namespace for import is incorrect. ### Description of changes We cannot fix the namespace now as this is stable modules and there're customers using it. Fixing this would be a breaking change to users who use apigatewayv2 in `aws-cdk-lib`. ### Description of how you validated changes N/A ### Checklist - [ ] 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* --- .../aws-apigatewayv2-authorizers/.jsiirc.json | 13 +++++++++ .../aws-apigatewayv2-authorizers/README.md | 26 +++++++++++++++++ .../.jsiirc.json | 13 +++++++++ .../aws-apigatewayv2-integrations/README.md | 28 ++++++++++++++++++- 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 packages/aws-cdk-lib/aws-apigatewayv2-authorizers/.jsiirc.json create mode 100644 packages/aws-cdk-lib/aws-apigatewayv2-integrations/.jsiirc.json diff --git a/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/.jsiirc.json b/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/.jsiirc.json new file mode 100644 index 0000000000000..9fbccc2314fc9 --- /dev/null +++ b/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/.jsiirc.json @@ -0,0 +1,13 @@ +{ + "targets": { + "dotnet": { + "namespace": "Amazon.CDK.AwsApigatewayv2Authorizers" + }, + "java": { + "package": "software.amazon.awscdk.aws_apigatewayv2_authorizers" + }, + "python": { + "module": "aws_cdk.aws_apigatewayv2_authorizers" + } + } +} diff --git a/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/README.md b/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/README.md index 2cef622ea1381..a633d395ce08a 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/README.md +++ b/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/README.md @@ -13,6 +13,9 @@ - [WebSocket APIs](#websocket-apis) - [Lambda Authorizer](#lambda-authorizer) - [IAM Authorizers](#iam-authorizer) +- [Import Issues](#import-issues) + - [DotNet Namespace](#dotnet-namespace) + - [Java Package](#java-package) ## Introduction @@ -280,3 +283,26 @@ user.attachInlinePolicy(new iam.Policy(this, 'AllowInvoke', { })); ``` + +## Import Issues + +`jsiirc.json` file is missing during the stablization process of this module, which caused import issues for DotNet and Java users who attempt to use this module. Unfortunately, to guarantee backward compatibility, we cannot simply correct the namespace for DotNet or package for Java. The following outlines the workaround. + +### DotNet Namespace + +Instead of the conventional namespace `Amazon.CDK.AWS.Apigatewayv2.Authorizers`, you would need to use the following namespace: + +```cs +using Amazon.CDK.AwsApigatewayv2Authorizers;; +``` + +### Java Package + +Instead of conventional package `import software.amazon.awscdk.services.apigatewayv2_authorizers.*`, you would need to use the following package: + +```java +import software.amazon.awscdk.aws_apigatewayv2_authorizers.*; + +// If you want to import a specific construct +import software.amazon.awscdk.aws_apigatewayv2_authorizers.WebSocketIamAuthorizer; +``` diff --git a/packages/aws-cdk-lib/aws-apigatewayv2-integrations/.jsiirc.json b/packages/aws-cdk-lib/aws-apigatewayv2-integrations/.jsiirc.json new file mode 100644 index 0000000000000..6ad7dc9b48919 --- /dev/null +++ b/packages/aws-cdk-lib/aws-apigatewayv2-integrations/.jsiirc.json @@ -0,0 +1,13 @@ +{ + "targets": { + "dotnet": { + "namespace": "Amazon.CDK.AwsApigatewayv2Integrations" + }, + "java": { + "package": "software.amazon.awscdk.aws_apigatewayv2_integrations" + }, + "python": { + "module": "aws_cdk.aws_apigatewayv2_integrations" + } + } +} diff --git a/packages/aws-cdk-lib/aws-apigatewayv2-integrations/README.md b/packages/aws-cdk-lib/aws-apigatewayv2-integrations/README.md index 4df90c5836218..9fd07172268e6 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2-integrations/README.md +++ b/packages/aws-cdk-lib/aws-apigatewayv2-integrations/README.md @@ -11,6 +11,9 @@ - [WebSocket APIs](#websocket-apis) - [Lambda WebSocket Integration](#lambda-websocket-integration) - [AWS WebSocket Integration](#aws-websocket-integration) +- [Import Issues](#import-issues) + - [DotNet Namespace](#dotnet-namespace) + - [Java Package](#java-package) ## HTTP APIs @@ -307,4 +310,27 @@ webSocketApi.addRoute('$connect', { ``` You can also set additional properties to change the behavior of your integration, such as `contentHandling`. -See [Working with binary media types for WebSocket APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-develop-binary-media-types.html). \ No newline at end of file +See [Working with binary media types for WebSocket APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-develop-binary-media-types.html). + +## Import Issues + +`jsiirc.json` file is missing during the stablization process of this module, which caused import issues for DotNet and Java users who attempt to use this module. Unfortunately, to guarantee backward compatibility, we cannot simply correct the namespace for DotNet or package for Java. The following outlines the workaround. + +### DotNet Namespace + +Instead of the conventional namespace `Amazon.CDK.AWS.Apigatewayv2.Integrations`, you would need to use the following namespace: + +```cs +using Amazon.CDK.AwsApigatewayv2Integrations; +``` + +### Java Package + +Instead of conventional package `import software.amazon.awscdk.services.apigatewayv2_integrations.*`, you would need to use the following package: + +```java +import software.amazon.awscdk.aws_apigatewayv2_integrations.*; + +// If you want to import a specific construct +import software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketAwsIntegration; +```