Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Nov 14, 2025

Reason for this change

Adds auto-generated L1 property mixins for all CloudFormation resources, providing type-safe property application with merge strategies.

Description of changes

  • Generates type-safe property mixins for every CloudFormation resource across all AWS services
  • Adds package.json exports for all service-specific mixin modules (e.g., @aws-cdk/mixins-preview/aws-s3/mixins)
  • Supports two merge strategies: MERGE (deep merge, default) and OVERWRITE (shallow assign)
  • Enables applying L1 properties to both L1 and L2 constructs with full TypeScript support
  • Updates README with L1 Property Mixins documentation and examples

Example usage:

import '@aws-cdk/mixins-preview/with';
import { CfnBucketPropsMixin } from '@aws-cdk/mixins-preview/aws-s3/mixins';

const bucket = new s3.Bucket(scope, "Bucket")
  .with(new CfnBucketPropsMixin({
    versioningConfiguration: { status: "Enabled" },
    publicAccessBlockConfiguration: {
      blockPublicAcls: true,
      blockPublicPolicy: true
    }
  }));

Describe any new or updated permissions being added

No new or updated IAM permissions.

Description of how you validated changes

  • Generated mixins for all AWS services
  • Verified type safety and merge strategies
  • Updated documentation with examples

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@mrgrain mrgrain requested a review from a team as a code owner November 14, 2025 12:55
@github-actions github-actions bot added the p2 label Nov 14, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 14, 2025 12:55
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 14, 2025
@mrgrain mrgrain changed the title chore(mixins-preview): implement Mixins RFC chore(mixins-preview): add L1 property mixins Nov 14, 2025
@mrgrain mrgrain changed the base branch from main to mrgrain/chore/mixins-pt-1 November 14, 2025 13:01
Base automatically changed from mrgrain/chore/mixins-pt-1 to main November 14, 2025 14:01
@mrgrain mrgrain changed the base branch from main to mrgrain/chore/spec2cdk-li-builder November 17, 2025 08:42
@mrgrain mrgrain force-pushed the mrgrain/chore/spec2cdk-li-builder branch from 5d0c245 to 414234a Compare November 17, 2025 08:47
@mrgrain mrgrain force-pushed the mrgrain/chore/mixins-l1-property-mixins branch from 8fc92a6 to b8fbd85 Compare November 17, 2025 08:51
@mrgrain mrgrain changed the title chore(mixins-preview): add L1 property mixins feat(mixins-preview): add auto-generated L1 property mixins Nov 17, 2025
@mrgrain mrgrain force-pushed the mrgrain/chore/mixins-l1-property-mixins branch from b8fbd85 to 2adf353 Compare November 17, 2025 09:43
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

@mrgrain mrgrain force-pushed the mrgrain/chore/mixins-l1-property-mixins branch from 2adf353 to f7027f9 Compare November 17, 2025 10:18
…tion

Introduces a new LibraryBuilder base class to abstract the code generation
process for CDK libraries. This refactoring separates concerns between the
general library building logic and aws-cdk-lib-specific implementation.

Key changes:
- Create LibraryBuilder base class with generic service submodule support
- Extract AwsCdkLibBuilder as a specialized implementation
- Introduce ServiceSubmodule abstraction for better modularity
- Move selective imports logic to service-submodule
- Update TypeConverter to support partial type definitions for mixins
- Adjust import paths and file patterns configuration
@mrgrain mrgrain force-pushed the mrgrain/chore/spec2cdk-li-builder branch from 0d5b24a to 50d3abe Compare November 17, 2025 11:23
@mrgrain mrgrain force-pushed the mrgrain/chore/mixins-l1-property-mixins branch from f7027f9 to cb9b9d4 Compare November 17, 2025 11:26
Base automatically changed from mrgrain/chore/spec2cdk-li-builder to main November 17, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants