aws / aws/aws-cdk

(WAFv2): CfnWebACL namespace incorrectly set as CfnWebAcl in C# JSII

Open
#25,530 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-wafv2 bug effort/medium jsii p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

When a library extends an interface in `cdk.aws_wafv2.CfnWebACL` (e.g. `export interface WafRuleProperty extends cdk.aws_wafv2.CfnWebACL.RuleProperty {};`), JSII compilation to C# fails for that library with the error: `error CS0234: The type or namespace name 'CfnWebAcl' does not exist in the namespace 'Amazon.CDK.AWS.WAFv2' (are you missing an assembly reference?)`.
This is due to the generated C# code using `CfnWebAcl` instead of `CfnWebACL`
![image](https://github.com/aws/aws-cdk/assets/45865322/1f19aaa0-6bfe-480e-8aa2-f76f04e91f41)

### Expected Behavior

Expected the JSII library to compile correctly into C#

### Current Behavior

JSII compilation fails with `error CS0234: The type or namespace name 'CfnWebAcl' does not exist in the namespace 'Amazon.CDK.AWS.WAFv2' (are you missing an assembly reference?)`

### Reproduction Steps

Clone the repo https://github.com/cgatt/jsii-dotnet-compilation and execute with `npx projen build`

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.72.1 (build ddbfac7)

### Framework Version

_No response_

### Node.js Version

16.20.0

### OS

Ubuntu

### Language

Typescript, .NET

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Clone https://github.com/cgatt/jsii-dotnet-compilation and run `npx projen build` to reproduce the generated C# reference to `CfnWebAcl`. Trace the JSII output for `cdk.aws_wafv2.CfnWebACL` and ensure the generated name preserves `CfnWebACL`; done means the reproduction compiles successfully in C#.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.