Skip to content

Commit

Permalink
Merge branch 'main' into chore/kafka-starting-position-timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
moelasmar authored Jan 12, 2025
2 parents 06afa32 + 9317203 commit 8577db4
Show file tree
Hide file tree
Showing 28 changed files with 101 additions and 237 deletions.
1 change: 0 additions & 1 deletion .github/workflows/issue-label-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ env:
{"area":"@aws-cdk/aws-inspector","keywords":["aws-inspector","inspector"],"labels":["@aws-cdk/aws-inspector"]},
{"area":"@aws-cdk/aws-iot","keywords":["internet-of-things","aws-iot","iot"],"labels":["@aws-cdk/aws-iot"],"affixes":{"suffixes":["-alpha"]}},
{"area":"@aws-cdk/aws-iot-actions","keywords":["aws-iot-actions","iot-actions"],"labels":["@aws-cdk/aws-iot-actions"],"affixes":{"suffixes":["-alpha"]}},
{"area":"@aws-cdk/aws-iot1click","keywords":["aws-iot1click","iot1click"],"labels":["@aws-cdk/aws-iot1click"]},
{"area":"@aws-cdk/aws-iotanalytics","keywords":["aws-iotanalytics","iotanalytics"],"labels":["@aws-cdk/aws-iotanalytics"]},
{"area":"@aws-cdk/aws-iotevents","keywords":["aws-iotevents","iotevents"],"labels":["@aws-cdk/aws-iotevents"],"affixes":{"suffixes":["-alpha"]}},
{"area":"@aws-cdk/aws-iotevents-actions","keywords":["aws-iotevents","iotevents-actions"],"labels":["@aws-cdk/aws-iotevents-actions"],"affixes":{"suffixes":["-alpha"]}},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/request-cli-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
persist-credentials: false
- name: Find changed cli files
id: changed-cli-files
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files_yaml: |
Expand Down
1 change: 1 addition & 0 deletions deprecated_apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1098,3 +1098,4 @@ aws-cdk-lib.pipelines.UpdatePipelineActionProps#pipelineStackHierarchicalId
aws-cdk-lib.pipelines.UpdatePipelineActionProps#pipelineStackName
aws-cdk-lib.pipelines.UpdatePipelineActionProps#privileged
aws-cdk-lib.pipelines.UpdatePipelineActionProps#projectName
aws-cdk-lib.iot1click
Original file line number Diff line number Diff line change
Expand Up @@ -2634,20 +2634,6 @@ integTest('hotswap ECS deployment respects properties override', withDefaultFixt
expect(describeServicesResponse.services?.[0].deploymentConfiguration?.maximumPercent).toEqual(ecsMaximumHealthyPercent);
}));

integTest('cdk destroy does not fail even if the stacks do not exist', withDefaultFixture(async (fixture) => {
const nonExistingStackName1 = 'non-existing-stack-1';
const nonExistingStackName2 = 'non-existing-stack-2';

await expect(fixture.cdkDestroy([nonExistingStackName1, nonExistingStackName2])).resolves.not.toThrow();
}));

integTest('cdk destroy with no force option exits without prompt if the stacks do not exist', withDefaultFixture(async (fixture) => {
const nonExistingStackName1 = 'non-existing-stack-1';
const nonExistingStackName2 = 'non-existing-stack-2';

await expect(fixture.cdk(['destroy', ...fixture.fullStackName([nonExistingStackName1, nonExistingStackName2])])).resolves.not.toThrow();
}));

async function listChildren(parent: string, pred: (x: string) => Promise<boolean>) {
const ret = new Array<string>();
for (const child of await fs.readdir(parent, { encoding: 'utf-8' })) {
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-ec2-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const acceptorVpc = new VpcV2(this, 'VpcA', {
const acceptorRoleArn = acceptorVpc.createAcceptorVpcRole('000000000000'); // Requestor account ID
```

After creating an IAM role in the acceptor account, we can initiate the peering connection request from the requestor VPC. Import accpeptorVpc to the stack using `fromVpcV2Attributes` method, it is recommended to specify owner account id of the acceptor VPC in case of cross account peering connection, if acceptor VPC is hosted in different region provide region value for import as well.
After creating an IAM role in the acceptor account, we can initiate the peering connection request from the requestor VPC. Import acceptorVpc to the stack using `fromVpcV2Attributes` method, it is recommended to specify owner account id of the acceptor VPC in case of cross account peering connection, if acceptor VPC is hosted in different region provide region value for import as well.
The following code snippet demonstrates how to set up VPC peering between two VPCs in different AWS accounts using CDK:

```ts
Expand Down Expand Up @@ -461,11 +461,11 @@ For more information, see [What is AWS Site-to-Site VPN?](https://docs.aws.amazo

VPN route propagation is a feature in Amazon Web Services (AWS) that automatically updates route tables in your Virtual Private Cloud (VPC) with routes learned from a VPN connection.

To enable VPN route propogation, use the `vpnRoutePropagation` property to specify the subnets as an input to the function. VPN route propagation will then be enabled for each subnet with the corresponding route table IDs.
To enable VPN route propagation, use the `vpnRoutePropagation` property to specify the subnets as an input to the function. VPN route propagation will then be enabled for each subnet with the corresponding route table IDs.

Additionally, you can set up a route in any route table with the target set to the VPN Gateway. The function `enableVpnGatewayV2` returns a `VPNGatewayV2` object that you can reference later.

The code example below provides the definition for setting up a VPN gateway with `vpnRoutePropogation` enabled:
The code example below provides the definition for setting up a VPN gateway with `vpnRoutePropagation` enabled:

```ts

Expand Down Expand Up @@ -494,7 +494,7 @@ An internet gateway is a horizontally scaled, redundant, and highly available VP
For more information, see [Enable VPC internet access using internet gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html).

You can add an internet gateway to a VPC using `addInternetGateway` method. By default, this method creates a route in all Public Subnets with outbound destination set to `0.0.0.0` for IPv4 and `::0` for IPv6 enabled VPC.
Instead of using the default settings, you can configure a custom destinatation range by providing an optional input `destination` to the method.
Instead of using the default settings, you can configure a custom destination range by providing an optional input `destination` to the method.

The code example below shows how to add an internet gateway with a custom outbound destination IP range:

Expand Down Expand Up @@ -539,13 +539,13 @@ const importedVpc = VpcV2.fromVpcV2Attributes(stack, 'ImportedVpc', {

In case of cross account or cross region VPC, its recommended to provide region and ownerAccountId so that these values for the VPC can be used to populate correct arn value for the VPC. If a VPC region and account ID is not provided, then region and account configured in the stack will be used. Furthermore, these fields will be referenced later while setting up VPC peering connection, so its necessary to set these fields to a correct value.

Below is an example of importing a cross region and cross acount VPC, VPC arn for this case would be 'arn:aws:ec2:us-west-2:123456789012:vpc/mockVpcID'
Below is an example of importing a cross region and cross account VPC, VPC arn for this case would be 'arn:aws:ec2:us-west-2:123456789012:vpc/mockVpcID'

``` ts

const stack = new Stack();

//Importing a cross acount or cross region VPC
//Importing a cross account or cross region VPC
const importedVpc = VpcV2.fromVpcV2Attributes(stack, 'ImportedVpc', {
vpcId: 'mockVpcID',
vpcCidrBlock: '10.0.0.0/16',
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cloudformation-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"license": "Apache-2.0",
"dependencies": {
"@aws-cdk/aws-service-spec": "^0.1.46",
"@aws-cdk/service-spec-types": "^0.0.112",
"@aws-cdk/aws-service-spec": "^0.1.48",
"@aws-cdk/service-spec-types": "^0.0.114",
"chalk": "^4",
"diff": "^5.2.0",
"fast-deep-equal": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/integ-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@aws-cdk/cloud-assembly-schema": "^39.0.0",
"@aws-cdk/cloudformation-diff": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/aws-service-spec": "^0.1.46",
"@aws-cdk/aws-service-spec": "^0.1.48",
"cdk-assets": "3.0.0-rc.111",
"@aws-cdk/cdk-cli-wrapper": "0.0.0",
"aws-cdk": "0.0.0",
Expand Down
13 changes: 0 additions & 13 deletions packages/aws-cdk-lib/aws-iot1click/.jsiirc.json

This file was deleted.

27 changes: 0 additions & 27 deletions packages/aws-cdk-lib/aws-iot1click/README.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/aws-cdk-lib/aws-iot1click/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/aws-cdk-lib/aws-iot1click/lib/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ new rds.DatabaseCluster(this, 'LimitlessDatabaseCluster', {
version: rds.AuroraPostgresEngineVersion.VER_16_4_LIMITLESS,
}),
vpc,
clusterScailabilityType: rds.ClusterScailabilityType.LIMITLESS,
clusterScalabilityType: rds.ClusterScalabilityType.LIMITLESS,
// Requires enabling Performance Insights
enablePerformanceInsights: true,
performanceInsightRetention: rds.PerformanceInsightRetention.MONTHS_1,
Expand Down
39 changes: 36 additions & 3 deletions packages/aws-cdk-lib/aws-rds/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,17 @@ interface DatabaseClusterBaseProps {
*
* Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.
*
* @default ClusterScalabilityType.STANDARD
*/
readonly clusterScalabilityType?: ClusterScalabilityType;

/**
* [Misspelled] Specifies the scalability mode of the Aurora DB cluster.
*
* Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.
*
* @default ClusterScailabilityType.STANDARD
* @deprecated Use clusterScalabilityType instead. This will be removed in the next major version.
*/
readonly clusterScailabilityType?: ClusterScailabilityType;
}
Expand Down Expand Up @@ -492,6 +502,25 @@ export enum InstanceUpdateBehaviour {
/**
* The scalability mode of the Aurora DB cluster.
*/
export enum ClusterScalabilityType {
/**
* The cluster uses normal DB instance creation.
*/
STANDARD = 'standard',

/**
* The cluster operates as an Aurora Limitless Database,
* allowing you to create a DB shard group for horizontal scaling (sharding) capabilities.
*
* @see https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/limitless.html
*/
LIMITLESS = 'limitless',
}

/**
* The scalability mode of the Aurora DB cluster.
* @deprecated Use ClusterScalabilityType instead. This will be removed in the next major version.
*/
export enum ClusterScailabilityType {
/**
* The cluster uses normal DB instance creation.
Expand Down Expand Up @@ -701,6 +730,10 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase {
constructor(scope: Construct, id: string, props: DatabaseClusterBaseProps) {
super(scope, id);

if (props.clusterScalabilityType !== undefined && props.clusterScailabilityType !== undefined) {
throw new Error('You cannot specify both clusterScalabilityType and clusterScailabilityType (deprecated). Use clusterScalabilityType.');
}

if ((props.vpc && props.instanceProps?.vpc) || (!props.vpc && !props.instanceProps?.vpc)) {
throw new Error('Provide either vpc or instanceProps.vpc, but not both');
}
Expand Down Expand Up @@ -802,7 +835,7 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase {
throw new Error('`enablePerformanceInsights` disabled, but `performanceInsightRetention` or `performanceInsightEncryptionKey` was set');
}

if (props.clusterScailabilityType === ClusterScailabilityType.LIMITLESS) {
if (props.clusterScalabilityType === ClusterScalabilityType.LIMITLESS || props.clusterScailabilityType === ClusterScailabilityType.LIMITLESS) {
if (!props.enablePerformanceInsights) {
throw new Error('Performance Insights must be enabled for Aurora Limitless Database.');
}
Expand Down Expand Up @@ -877,7 +910,7 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase {
}),
storageType: props.storageType?.toString(),
enableLocalWriteForwarding: props.enableLocalWriteForwarding,
clusterScalabilityType: props.clusterScailabilityType,
clusterScalabilityType: props.clusterScalabilityType ?? props.clusterScailabilityType,
// Admin
backtrackWindow: props.backtrackWindow?.toSeconds(),
backupRetentionPeriod: props.backup?.retention?.toDays(),
Expand Down Expand Up @@ -1287,7 +1320,7 @@ export class DatabaseCluster extends DatabaseClusterNew {
setLogRetention(this, props);

// create the instances for only standard aurora clusters
if (props.clusterScailabilityType !== ClusterScailabilityType.LIMITLESS) {
if (props.clusterScalabilityType !== ClusterScalabilityType.LIMITLESS && props.clusterScailabilityType !== ClusterScailabilityType.LIMITLESS) {
if ((props.writer || props.readers) && (props.instances || props.instanceProps)) {
throw new Error('Cannot provide writer or readers if instances or instanceProps are provided');
}
Expand Down
36 changes: 32 additions & 4 deletions packages/aws-cdk-lib/aws-rds/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,34 @@ import {
DatabaseClusterEngine, DatabaseClusterFromSnapshot, ParameterGroup, PerformanceInsightRetention, SubnetGroup, DatabaseSecret,
DatabaseInstanceEngine, SqlServerEngineVersion, SnapshotCredentials, InstanceUpdateBehaviour, NetworkType, ClusterInstance, CaCertificate,
IClusterEngine,
ClusterScalabilityType,
ClusterScailabilityType,
DBClusterStorageType,
} from '../lib';

describe('cluster new api', () => {
describe('errors are thrown', () => {
test('when both clusterScalabilityType and clusterScailabilityType (deprecated) props are provided', () => {
// GIVEN
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');

expect(() => {
// WHEN
new DatabaseCluster(stack, 'Database', {
engine: DatabaseClusterEngine.AURORA_MYSQL,
instanceProps: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
vpc,
},
clusterScalabilityType: ClusterScalabilityType.STANDARD,
clusterScailabilityType: ClusterScailabilityType.STANDARD,
iamAuthentication: true,
});
// THEN
}).toThrow('You cannot specify both clusterScalabilityType and clusterScailabilityType (deprecated). Use clusterScalabilityType.');
});

test('when old and new props are provided', () => {
// GIVEN
const stack = testStack();
Expand Down Expand Up @@ -165,7 +187,10 @@ describe('cluster new api', () => {
});
});

test('cluster scalability option', () => {
test.each([
['clusterScalabilityType', 'clusterScalabilityType', ClusterScalabilityType.STANDARD],
['clusterScailabilityType (deprecated)', 'clusterScailabilityType', ClusterScailabilityType.STANDARD],
])('cluster scalability option with %s', (_, propName, propValue) => {
// GIVEN
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');
Expand All @@ -174,8 +199,8 @@ describe('cluster new api', () => {
new DatabaseCluster(stack, 'Cluster', {
engine: DatabaseClusterEngine.AURORA_MYSQL,
vpc,
clusterScailabilityType: ClusterScailabilityType.STANDARD,
writer: ClusterInstance.serverlessV2('writer'),
[propName]: propValue,
});

// THEN
Expand All @@ -186,7 +211,10 @@ describe('cluster new api', () => {
});

describe('limitless database', () => {
test('with default options', () => {
test.each([
['clusterScalabilityType', 'clusterScalabilityType', ClusterScalabilityType.LIMITLESS],
['clusterScailabilityType (deprecated)', 'clusterScailabilityType', ClusterScailabilityType.LIMITLESS],
])('with default options using %s', (_, propName, propValue) => {
// GIVEN
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');
Expand All @@ -197,7 +225,7 @@ describe('cluster new api', () => {
version: AuroraPostgresEngineVersion.VER_16_4_LIMITLESS,
}),
vpc,
clusterScailabilityType: ClusterScailabilityType.LIMITLESS,
[propName]: propValue,
enablePerformanceInsights: true,
performanceInsightRetention: PerformanceInsightRetention.MONTHS_1,
monitoringInterval: cdk.Duration.minutes(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
"forecastqueryservice": "forecastquery",
"forecastservice": "forecast",
"globalaccelerator": "global-accelerator",
"iot1clickdevicesservice": "iot-1click-devices-service",
"iot1clickprojects": "iot-1click-projects",
"iotevents": "iot-events",
"ioteventsdata": "iot-events-data",
"iotjobsdataplane": "iot-jobs-data-plane",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,6 @@
"internetmonitor": {
"iamPrefix": "internetmonitor"
},
"iot-1click-devices-service": {
"iamPrefix": "iot1click"
},
"iot-1click-projects": {
"iamPrefix": "iot1click"
},
"iot-data-plane": {
"iamPrefix": "iotdata"
},
Expand Down
16 changes: 0 additions & 16 deletions packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1439,22 +1439,6 @@ If the flag is set to false then a custom resource will be created when using `U
| (not in v1) | | |
| 2.174.0 | `false` | `true` |

### @aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource

*When enabled, use a new method for DNS Name of user pool domain target without creating a custom resource.* (fix)

When this feature flag is enabled, a new method will be used to get the DNS Name of the user pool domain target. The old method
creates a custom resource internally, but the new method doesn't need a custom resource.

If the flag is set to false then a custom resource will be created when using `UserPoolDomainTarget`.


| Since | Default | Recommended |
| ----- | ----- | ----- |
| (not in v1) | | |
| 2.174.0 | `false` | `true` |


### @aws-cdk/aws-ecs:disableEcsImdsBlocking

*When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false. **IMPORTANT: See [details.](#aws-cdkaws-ecsdisableEcsImdsBlocking)*** (temporary)
Expand Down
1 change: 0 additions & 1 deletion packages/aws-cdk-lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export * as aws_inspectorv2 from './aws-inspectorv2';
export * as aws_internetmonitor from './aws-internetmonitor';
export * as aws_invoicing from './aws-invoicing';
export * as aws_iot from './aws-iot';
export * as aws_iot1click from './aws-iot1click';
export * as aws_iotanalytics from './aws-iotanalytics';
export * as aws_iotcoredeviceadvisor from './aws-iotcoredeviceadvisor';
export * as aws_iotevents from './aws-iotevents';
Expand Down
Loading

0 comments on commit 8577db4

Please sign in to comment.