Skip to content
Closed
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
3 changes: 3 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4164,3 +4164,6 @@ removed:aws-cdk-lib.aws_lambda.MetricType.KAFKAMETRICS
# Never intended to be mutable, not usefully mutable
removed-mutability:aws-cdk-lib.aws_s3.Bucket.grants
removed-mutability:aws-cdk-lib.aws_s3.BucketBase.grants

# Parameter was made optional in override but base class requires it (JSII5008). Method is @deprecated.
new-argument:aws-cdk-lib.aws_events_targets.LogGroupTargetInput.fromObject
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
"DatabaseName": "integdb",
"EnableHttpEndpoint": true,
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
"DatabaseName": "integdb",
"EnableHttpEndpoint": true,
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@
"instance"
],
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@
},
"EnableHttpEndpoint": true,
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@
},
"EnableLocalWriteForwarding": true,
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@
"Ref": "ClusterSubnetsDCFA5CB7"
},
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
"Ref": "DatabaseSubnets56F17B9A"
},
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": "7959866cacc02c2d243ecfe177464fe6",
"MasterUsername": "adminuser",
"Port": 5432,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@
"Ref": "PostgresDatabaseSubnets7DD9954C"
},
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"Ref": "dbClusterSubnets03B9B0E1"
},
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down Expand Up @@ -1506,7 +1506,7 @@
"Ref": "dbClusterWithWriterAndReadersSubnetsD9FBAD2A"
},
"Engine": "aurora-postgresql",
"EngineVersion": "17.7",
"EngineVersion": "17.9",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions packages/aws-cdk-lib/aws-events-targets/lib/log-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface LogGroupTargetInputOptions {
/**
* The input to send to the CloudWatch LogGroup target
*/
export abstract class LogGroupTargetInput {
export abstract class LogGroupTargetInput extends RuleTargetInput {
/**
* Pass a JSON object to the log group event target
*
Expand All @@ -47,7 +47,7 @@ export abstract class LogGroupTargetInput {
*
* @deprecated use fromObjectV2
*/
public static fromObject(options?: LogGroupTargetInputOptions): RuleTargetInput {
public static fromObject(options: any): RuleTargetInput {
return RuleTargetInput.fromObject({
timestamp: options?.timestamp ?? EventField.time,
message: options?.message ?? EventField.detailType,
Expand All @@ -61,16 +61,29 @@ export abstract class LogGroupTargetInput {
* matched event.
*/
public static fromObjectV2(options?: LogGroupTargetInputOptions): LogGroupTargetInput {
return new events.FieldAwareEventInput({
return new LogGroupFieldAwareInput({
timestamp: options?.timestamp ?? EventField.time,
message: options?.message ?? EventField.detailType,
}, InputType.Object);
});
}
}

/**
* Return the input properties for this input object
*/
public abstract bind(rule: IRule): RuleTargetInputProperties;
/**
* A LogGroupTargetInput that delegates to FieldAwareEventInput.
* This ensures the returned object is nominally a LogGroupTargetInput
* for JSII-generated languages (Python, Java).
*/
class LogGroupFieldAwareInput extends LogGroupTargetInput {
private readonly inner: events.FieldAwareEventInput;

constructor(obj: any) {
super();
this.inner = new events.FieldAwareEventInput(obj, InputType.Object);
}

public bind(rule: IRule): RuleTargetInputProperties {
return this.inner.bind(rule);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ import * as cdk from '../../../core';
import * as targets from '../../lib';
import { LogGroupTargetInput } from '../../lib';

test('fromObjectV2 returns instanceof LogGroupTargetInput', () => {
const input = LogGroupTargetInput.fromObjectV2();
expect(input).toBeInstanceOf(LogGroupTargetInput);
});

test('fromObjectV2 returns instanceof RuleTargetInput', () => {
const input = LogGroupTargetInput.fromObjectV2();
expect(input).toBeInstanceOf(events.RuleTargetInput);
});

test('use log group as an event rule target', () => {
// GIVEN
const stack = new cdk.Stack();
Expand Down Expand Up @@ -96,7 +106,7 @@ testDeprecated('cannot use both logEvent and event', () => {
event: events.RuleTargetInput.fromObject({
message: events.EventField.fromPath('$'),
}),
logEvent: LogGroupTargetInput.fromObject(),
logEvent: LogGroupTargetInput.fromObject({}),
}));
}).toThrow(/Only one of "event" or "logEvent" can be specified/);
});
Expand Down Expand Up @@ -135,7 +145,7 @@ test('logEvent with defaults', () => {

// WHEN
rule1.addTarget(new targets.CloudWatchLogGroup(logGroup, {
logEvent: LogGroupTargetInput.fromObject(),
logEvent: LogGroupTargetInput.fromObject({}),
}));

// THEN
Expand Down
6 changes: 6 additions & 0 deletions packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,8 @@ export class AuroraPostgresEngineVersion {
public static readonly VER_14_19 = AuroraPostgresEngineVersion.of('14.19', '14', { s3Import: true, s3Export: true });
/** Version "14.20". */
public static readonly VER_14_20 = AuroraPostgresEngineVersion.of('14.20', '14', { s3Import: true, s3Export: true });
/** Version "14.22". */
public static readonly VER_14_22 = AuroraPostgresEngineVersion.of('14.22', '14', { s3Import: true, s3Export: true });

/**
* Version "15.2".
Expand Down Expand Up @@ -1322,6 +1324,8 @@ export class AuroraPostgresEngineVersion {
public static readonly VER_15_14 = AuroraPostgresEngineVersion.of('15.14', '15', { s3Import: true, s3Export: true });
/** Version "15.15". */
public static readonly VER_15_15 = AuroraPostgresEngineVersion.of('15.15', '15', { s3Import: true, s3Export: true });
/** Version "15.17". */
public static readonly VER_15_17 = AuroraPostgresEngineVersion.of('15.17', '15', { s3Import: true, s3Export: true });

/**
* Version "16.0"
Expand Down Expand Up @@ -1393,6 +1397,8 @@ export class AuroraPostgresEngineVersion {
public static readonly VER_17_6 = AuroraPostgresEngineVersion.of('17.6', '17', { s3Import: true, s3Export: true });
/** Version "17.7". */
public static readonly VER_17_7 = AuroraPostgresEngineVersion.of('17.7', '17', { s3Import: true, s3Export: true });
/** Version "17.9". */
public static readonly VER_17_9 = AuroraPostgresEngineVersion.of('17.9', '17', { s3Import: true, s3Export: true });

/**
* Create a new AuroraPostgresEngineVersion with an arbitrary version.
Expand Down
Loading