Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.230.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.229.1-alpha.0...v2.230.0-alpha.0) (2025-11-26)


### Features

* **bedrock-agentcore-alpha:** update resources on grantInvokeXXX for runtime ([#35864](https://github.com/aws/aws-cdk/issues/35864)) ([5dad62f](https://github.com/aws/aws-cdk/commit/5dad62f94c1a9f02c5fda1df7aa105e14630beb3))
* **imagebuilder-alpha:** add support for Image Pipeline Construct ([#36153](https://github.com/aws/aws-cdk/issues/36153)) ([d8c324a](https://github.com/aws/aws-cdk/commit/d8c324ae31db5997f9511e3f43affceea57d86c3)), closes [aws/aws-cdk-rfcs#789](https://github.com/aws/aws-cdk-rfcs/issues/789) [aws/aws-cdk-rfcs#789](https://github.com/aws/aws-cdk-rfcs/issues/789)
* **imagebuilder-alpha:** add support for Lifecycle Policy Construct ([#36152](https://github.com/aws/aws-cdk/issues/36152)) ([7e31eb6](https://github.com/aws/aws-cdk/commit/7e31eb6a310344634fefa0651bf55c7493fc09bd)), closes [aws/aws-cdk-rfcs#789](https://github.com/aws/aws-cdk-rfcs/issues/789) [aws/aws-cdk-rfcs#789](https://github.com/aws/aws-cdk-rfcs/issues/789)
* **mixins-preview:** adds LogDelivery Mixins for 47 resources ([#36158](https://github.com/aws/aws-cdk/issues/36158)) ([6607ce9](https://github.com/aws/aws-cdk/commit/6607ce95256acda86107fa30b1f000a9dc189df7))
* **mixins-preview:** vended log deliveries ([#36138](https://github.com/aws/aws-cdk/issues/36138)) ([69442a8](https://github.com/aws/aws-cdk/commit/69442a88b16b39d485bf7ec57d520599c564a612))
* **mixins-preview:** helpers to generate EventBridge event patterns for 26 services ([#36121](https://github.com/aws/aws-cdk/issues/36121)) ([073185d](https://github.com/aws/aws-cdk/commit/073185d46e5d8a95915579013d1ef8fe47e6343c))


### Bug Fixes

* **mixins-preview:** `AutoDeleteObjects` mixin fails with cannot find file error ([#36188](https://github.com/aws/aws-cdk/issues/36188)) ([3ef337d](https://github.com/aws/aws-cdk/commit/3ef337dba5d9f6f13ca8faa84376bd9177a7ecbd)), closes [aws-cdk/mixins-preview/lib/custom-resource-handlers/aws-s3/auto-delete-objects-provider.ts#L21](https://github.com/aws-cdk/mixins-preview/lib/custom-resource-handlers/aws-s3/auto-delete-objects-provider.ts/issues/L21)
* **mixins-preview:** `ResourcePolicy with this name already exists` error when setting up `LogDelivery` ([#36195](https://github.com/aws/aws-cdk/issues/36195)) ([f9aa31d](https://github.com/aws/aws-cdk/commit/f9aa31d021400aee8e172b3b0c949cd2d00473f7))
* **mixins-preview:** cannot use string literal types for `S3LogsDeliveryProps.permissionsVersion` ([#36197](https://github.com/aws/aws-cdk/issues/36197)) ([cc491df](https://github.com/aws/aws-cdk/commit/cc491df13f6a4e62e0233b90dcc636efa34e32d7))

## [2.229.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.229.0-alpha.0...v2.229.1-alpha.0) (2025-11-25)

## [2.229.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.228.0-alpha.0...v2.229.0-alpha.0) (2025-11-24)
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.230.0](https://github.com/aws/aws-cdk/compare/v2.229.1...v2.230.0) (2025-11-26)


### Features

* **apigateway:** support response streaming with response transfer mode ([#36155](https://github.com/aws/aws-cdk/issues/36155)) ([f431021](https://github.com/aws/aws-cdk/commit/f4310219ae134a03693330cb55da5fa1cb789c48)), closes [#36156](https://github.com/aws/aws-cdk/issues/36156)
* update L1 CloudFormation resource definitions ([f203b8e](https://github.com/aws/aws-cdk/commit/f203b8e2d1af592b70bfe8d1cafc496c5a28b0df))
* update L1 CloudFormation resource definitions ([#36193](https://github.com/aws/aws-cdk/issues/36193)) ([d074024](https://github.com/aws/aws-cdk/commit/d0740240d4dc52524faa8328467c92c360f52cc8))
* **events:** the L2 `EventPattern` interfaces can be used with `CfnRule` ([#36191](https://github.com/aws/aws-cdk/issues/36191)) ([efc135e](https://github.com/aws/aws-cdk/commit/efc135e60cacc55ccdf3b347c08fb78e5b735d3d))
* update L1 CloudFormation resource definitions ([#36180](https://github.com/aws/aws-cdk/issues/36180)) ([5cddd7e](https://github.com/aws/aws-cdk/commit/5cddd7ec34392198436710635bcee1921ce35d10))


### Bug Fixes

* **ecs:** wrong ARN generated in `Cluster.grantTaskProtection` method ([#36207](https://github.com/aws/aws-cdk/issues/36207)) ([9b337df](https://github.com/aws/aws-cdk/commit/9b337dfe2ca0a3920f9542802da73b670915fe01))
* **ecs-patterns:** target group ID changes without setting feature flag ([#36199](https://github.com/aws/aws-cdk/issues/36199)) ([b7ca082](https://github.com/aws/aws-cdk/commit/b7ca082ec460db7eccd96661623fb7f7cb26c34e)), closes [#36149](https://github.com/aws/aws-cdk/issues/36149)
* **scheduler:** wrong ARN generated in `ScheduleGroup.grant*` methods ([#36175](https://github.com/aws/aws-cdk/issues/36175)) ([eae8838](https://github.com/aws/aws-cdk/commit/eae88380aa71bd841279fdfa37120ed244dd5eae))

## [2.229.1](https://github.com/aws/aws-cdk/compare/v2.229.0...v2.229.1) (2025-11-25)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as events from 'aws-cdk-lib/aws-events';
import * as iam from 'aws-cdk-lib/aws-iam';
import { CfnImagePipeline } from 'aws-cdk-lib/aws-imagebuilder';
import * as logs from 'aws-cdk-lib/aws-logs';
import { addConstructMetadata, MethodMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
import { Construct } from 'constructs';
import { IDistributionConfiguration } from './distribution-configuration';
Expand Down Expand Up @@ -636,6 +637,8 @@ export class ImagePipeline extends ImagePipelineBase {
}).toLowerCase(), // Enforce lowercase for the auto-generated fallback
}),
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

Object.defineProperty(this, IMAGE_PIPELINE_SYMBOL, { value: true });

Expand Down Expand Up @@ -699,6 +702,7 @@ export class ImagePipeline extends ImagePipelineBase {
*
* @param grantee The execution role used for the image build.
*/
@MethodMetadata()
public grantDefaultExecutionRolePermissions(grantee: iam.IGrantable): iam.Grant[] {
const policies = defaultExecutionRolePolicy(this, this.props);
return policies.map((policy) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as cdk from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';
import { CfnLifecyclePolicy } from 'aws-cdk-lib/aws-imagebuilder';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
import { Construct } from 'constructs';
import { IRecipeBase } from './recipe-base';
Expand Down Expand Up @@ -432,6 +433,8 @@ export class LifecyclePolicy extends LifecyclePolicyBase {
}).toLowerCase(),
}),
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

Object.defineProperty(this, LIFECYCLE_POLICY_SYMBOL, { value: true });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class EventBridgeEventsClass extends ClassType {
eventNsName,
event,
typeDef,
addMetadata,
}: {
/** The interface or struct to add properties to */
target: InterfaceType | StructType;
Expand All @@ -194,6 +195,7 @@ class EventBridgeEventsClass extends ClassType {
event: Event;
/** Type definition for resource field identification */
typeDef: TypeDefinition;
addMetadata: boolean;
}): FreeFunction {
const propertyMappings = new Map<string, { original: string; type: Type; resolver?: Expression }>();
const module = Module.of(this);
Expand Down Expand Up @@ -228,6 +230,18 @@ class EventBridgeEventsClass extends ClassType {
},
});
}
if (addMetadata) {
target.addProperty({
name: 'eventMetadata',
type: CDK_CORE.AWSEventMetadataProps,
optional: true,
immutable: true,
docs: {
summary: 'EventBridge event metadata',
default: '-',
},
});
}

// Generate converter function
const converterFunction = new FreeFunction(module, {
Expand Down Expand Up @@ -329,6 +343,7 @@ class EventBridgeEventsClass extends ClassType {
eventNsName,
event,
typeDef,
addMetadata: false,
});
}
};
Expand Down Expand Up @@ -364,10 +379,10 @@ class EventBridgeEventsClass extends ClassType {

// Create detail interface with event properties
const detailInterface = new InterfaceType(eventNamespace, {
name: `${namespaceName}Detail`,
name: `${namespaceName}Props`,
export: true,
docs: {
summary: `Detail type for ${this.resource.name} ${event.name} event`,
summary: `Props type for ${this.resource.name} ${event.name} event`,
},
});

Expand All @@ -380,26 +395,7 @@ class EventBridgeEventsClass extends ClassType {
eventNsName: namespaceName,
event,
typeDef: rootProperty,
});

// Create pattern props interface extending detail with metadata
const propInterface = new InterfaceType(eventNamespace, {
name: 'PatternProps',
export: true,
extends: [detailInterface.type],
docs: {
summary: `Properties for ${this.resource.name} ${event.name} event pattern`,
},
});
propInterface.addProperty({
name: 'eventMetadata',
type: CDK_CORE.AWSEventMetadataProps,
optional: true,
immutable: true,
docs: {
summary: 'EventBridge event metadata',
default: '-',
},
addMetadata: true,
});

// Create event pattern method that returns events.EventPattern
Expand All @@ -411,27 +407,21 @@ class EventBridgeEventsClass extends ClassType {
summary: `EventBridge event pattern for ${this.resource.name} ${event.detailType}`,
},
});
const eventPatternMethodParam = eventPatternMethod.addParameter({
eventPatternMethod.addParameter({
name: 'options',
type: propInterface.type,
type: detailInterface.type,
optional: true,
});

const eventMetadata = expr.ident('eventMetadata');

eventPatternMethod.addBody(
stmt.constVar(
expr.destructuringObject(eventMetadata, expr.directCode('...obj')),
expr.binOp(expr.ident(eventPatternMethodParam.spec.name), '||', expr.lit({})),
),
stmt.ret(
expr.object({
source: expr.list([expr.lit(event.source)]),
detailType: expr.list([expr.lit(event.detailType)]),
detail: expr.ident(converterFunction.name).call(expr.ident('obj'), expr.this_().prop(this.referenceName)),
version: expr.directCode('eventMetadata?.version'),
resources: expr.directCode('eventMetadata?.resources'),
region: expr.directCode('eventMetadata?.region'),
detail: expr.ident(converterFunction.name).call(expr.ident('options'), expr.this_().prop(this.referenceName)),
version: expr.directCode('options?.eventMetadata?.version'),
resources: expr.directCode('options?.eventMetadata?.resources'),
region: expr.directCode('options?.eventMetadata?.region'),
}),
),
);
Expand Down
30 changes: 30 additions & 0 deletions packages/@aws-cdk/mixins-preview/test/events/l1-l2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,36 @@ describe.each([
},
});
});

test('should always have a bucketRef when empty props is passed', () => {
// GIVEN
const bucketEvents = BucketEvents.fromBucket(new class extends Construct {
public readonly bucketRef = {
bucketArn: 'arn',
bucketName: 'the-bucket',
};
public readonly env = { account: '11111111111', region: 'us-east-1' };
}(stack, 'Bucket'));

// WHEN
newRule(stack, bucketEvents.objectCreatedPattern({
eventMetadata: {
region: ['my-region'],
},
}));

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', {
EventPattern: {
'detail-type': ['Object Created'],
'source': ['aws.s3'],
'detail': {
bucket: { name: ['the-bucket'] },
},
'region': ['my-region'],
},
});
});
});

test('creates multiple rules for different event types', () => {
Expand Down
Loading
Loading