aws / aws/aws-cdk

core: Allow adding custom types to check CloudFormation-Validate::F3006

Open
#38,426 1 comment 1 reaction 0 assignees View on GitHub
@aws-cdk/core effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

After #38412 the check would only validate `AWS::` and I would like to opt-in to checking resources in a custom namespace, like `My::Resource::Example`, against a list of types I define.

### Use Case

By defining additional types I could check for typos or unknown types of a well-documented namespace.

I think it would be beneficial, if the opt-in can be done on a namespace by namespace basis. So that I am not forced to define all types I use, deal with a bunch of warnings of a namespace whose types I did not define or acknowledge F3006 and loose the feature alltogether.

### Proposed Solution

I would like some statically accessible method to define types.

I think having to create a custom `CloudFormationValidatePlugin` would not be beneficial for now, as it is hard to instantiate it once per app to replace the one that is [added by default](https://github.com/aws/aws-cdk/blob/v2.262.0/packages/aws-cdk-lib/core/lib/private/synthesis-validation.ts#L213).

### Other Information

I would like to use this as part of a cdk library. In that library I am sharing (L1, L2 and L3) Constructs with a custom namespace and I would like user's of said library to rely on the types I defined for that namespace.

Since the L1 constructs are generated by jsii, I am looking forward to any suggestions, when to call the proposed method to add defined types. Or include it in the generated code by jsii itself.

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.262.0

### AWS CDK CLI version

2.1132.0

### Environment details (OS name and version, etc.)

macOS Version 26.5.2 (25F84)

Contributor guide

Open the contributing guide

Research direction

Start by reading packages/aws-cdk-lib/core/lib/private/synthesis-validation.ts, especially the CloudFormationValidatePlugin registration linked in the issue, and trace how F3006 receives its resource types. Done means a library can opt in to custom namespaces and types through a statically accessible mechanism, while unrelated namespaces do not produce warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.