Skip to content

Commit

Permalink
chore(apigatewayv2): add apigatewayv2 integrations and authorizers to…
Browse files Browse the repository at this point in the history
… jsiirc (aws#30461)

### Issue # (if applicable)

Closes aws#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*
  • Loading branch information
GavinZZ authored and Leonardo Gama committed Jun 11, 2024
1 parent 6e8d9ea commit 656886c
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/aws-cdk-lib/aws-apigatewayv2-authorizers/.jsiirc.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
26 changes: 26 additions & 0 deletions packages/aws-cdk-lib/aws-apigatewayv2-authorizers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
```
13 changes: 13 additions & 0 deletions packages/aws-cdk-lib/aws-apigatewayv2-integrations/.jsiirc.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
28 changes: 27 additions & 1 deletion packages/aws-cdk-lib/aws-apigatewayv2-integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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).
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;
```

0 comments on commit 656886c

Please sign in to comment.