diff --git a/.gitattributes b/.gitattributes index df5eafe8a4ebc..82b1d5b189b92 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,3 +11,8 @@ *.jpg binary *.tgz binary *.tar.gz binary + +# Hide snapshots from GitHub UI, except for the actual templates +**/*.snapshot/** linguist-generated +**/*.snapshot/**/*.template.json -linguist-generated +**/*.snapshot/**/*DeployAssert*.template.json linguist-generated diff --git a/.github/workflows/request-cli-integ-test.yml b/.github/workflows/request-cli-integ-test.yml index 529940e7a0c4c..e080a6433769a 100644 --- a/.github/workflows/request-cli-integ-test.yml +++ b/.github/workflows/request-cli-integ-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false - name: Find changed cli files id: changed-cli-files - uses: tj-actions/changed-files@76c4d81a6acd339b55bd7407a016981c853eb702 + uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 with: base_sha: ${{ github.event.pull_request.base.sha }} files_yaml: | diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index 1a3cb5f6e55f3..9371476197d49 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,8 @@ 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.97.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.97.0-alpha.0...v2.97.1-alpha.0) (2023-09-25) + ## [2.97.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.96.2-alpha.0...v2.97.0-alpha.0) (2023-09-22) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 6f19c88135206..eea568c5c58c0 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,13 @@ 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.97.1](https://github.com/aws/aws-cdk/compare/v2.97.0...v2.97.1) (2023-09-25) + + +### Reverts + +* "feat(core): `Schedule` class" ([#27284](https://github.com/aws/aws-cdk/issues/27284)) ([e2fc724](https://github.com/aws/aws-cdk/commit/e2fc7240672b5c26394b2fe420531d62fe74189b)), closes [aws/aws-cdk#27105](https://github.com/aws/aws-cdk/issues/27105) [#27259](https://github.com/aws/aws-cdk/issues/27259) + ## [2.97.0](https://github.com/aws/aws-cdk/compare/v2.96.2...v2.97.0) (2023-09-22) diff --git a/allowed-breaking-changes.txt b/allowed-breaking-changes.txt index dba2f0f6dc042..fa46211a9dbef 100644 --- a/allowed-breaking-changes.txt +++ b/allowed-breaking-changes.txt @@ -191,3 +191,38 @@ removed:aws-cdk-lib.aws_ec2.CfnNetworkInterfaceProps.enablePrimaryIpv6 # Changed type from GraphqlApi to IGraphqlApi to support import from a different stack, should not matter. weakened:aws-cdk-lib.aws_appsync.SourceApi + +# Due to https://github.com/aws/aws-cdk/issues/27259, none of these could have worked +# When reimplemented, we can remove this entry entirely +removed:aws-cdk-lib.Schedule +removed:aws-cdk-lib.aws_backup.Schedule +removed:aws-cdk-lib.CronOptions +base-types:aws-cdk-lib.aws_applicationautoscaling.Schedule +removed:aws-cdk-lib.aws_applicationautoscaling.Schedule.protectedAt +removed:aws-cdk-lib.aws_applicationautoscaling.Schedule.protectedCron +removed:aws-cdk-lib.aws_applicationautoscaling.Schedule.protectedExpression +removed:aws-cdk-lib.aws_applicationautoscaling.Schedule.protectedRate +removed-argument:aws-cdk-lib.aws_applicationautoscaling.Schedule.at +incompatible-argument:aws-cdk-lib.aws_applicationautoscaling.Schedule.cron +removed-argument:aws-cdk-lib.aws_applicationautoscaling.Schedule.expression +removed:aws-cdk-lib.aws_applicationautoscaling.Schedule.timeZone +base-types:aws-cdk-lib.aws_autoscaling.Schedule +removed:aws-cdk-lib.aws_autoscaling.Schedule.protectedAt +removed:aws-cdk-lib.aws_autoscaling.Schedule.protectedCron +removed:aws-cdk-lib.aws_autoscaling.Schedule.protectedExpression +removed:aws-cdk-lib.aws_autoscaling.Schedule.protectedRate +incompatible-argument:aws-cdk-lib.aws_autoscaling.Schedule.cron +removed-argument:aws-cdk-lib.aws_autoscaling.Schedule.expression +removed:aws-cdk-lib.aws_autoscaling.Schedule.timeZone +base-types:aws-cdk-lib.aws_events.Schedule +removed:aws-cdk-lib.aws_events.Schedule.protectedAt +removed:aws-cdk-lib.aws_events.Schedule.protectedCron +removed:aws-cdk-lib.aws_events.Schedule.protectedExpression +removed:aws-cdk-lib.aws_events.Schedule.protectedRate +removed:aws-cdk-lib.aws_events.Schedule.timeZone +base-types:aws-cdk-lib.aws_applicationautoscaling.CronOptions +removed:aws-cdk-lib.aws_applicationautoscaling.CronOptions.timeZone +base-types:aws-cdk-lib.aws_autoscaling.CronOptions +removed:aws-cdk-lib.aws_autoscaling.CronOptions.timeZone +removed:aws-cdk-lib.aws_autoscaling.CronOptions.year +removed:aws-cdk-lib.aws_backup.BackupPlanRuleProps.schedule diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json index 967f653a106aa..19ddf51ac30c3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json @@ -1,7 +1,7 @@ { - "version": "34.0.0", + "version": "32.0.0", "files": { - "7617f116cb014747232d2ebeb42fb3e22242c4b0987526daf7a033aba236d976": { + "0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5": { "source": { "path": "cdk-backup.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7617f116cb014747232d2ebeb42fb3e22242c4b0987526daf7a033aba236d976.json", + "objectKey": "0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json index e1d8a605c90e0..2722b98da789d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json @@ -83,7 +83,6 @@ }, "RuleName": "Daily", "ScheduleExpression": "cron(0 5 * * ? *)", - "ScheduleExpressionTimezone": "Etc/UTC", "TargetBackupVault": { "Fn::GetAtt": [ "Vault23237E5B", @@ -97,7 +96,6 @@ }, "RuleName": "Weekly", "ScheduleExpression": "cron(0 5 ? * SAT *)", - "ScheduleExpressionTimezone": "Etc/UTC", "TargetBackupVault": { "Fn::GetAtt": [ "Vault23237E5B", @@ -112,7 +110,6 @@ }, "RuleName": "Monthly5Year", "ScheduleExpression": "cron(0 5 1 * ? *)", - "ScheduleExpressionTimezone": "Etc/UTC", "TargetBackupVault": { "Fn::GetAtt": [ "Vault23237E5B", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk.out index 2313ab5436501..f0b901e7c06e5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"32.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json index b044eefcaffbb..266124ac58c12 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "33.0.0", "testCases": { "integ.backup": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json index 85402b8c54933..aa4d73d1faac8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "33.0.0", "artifacts": { "cdk-backup.assets": { "type": "cdk:asset-manifest", @@ -14,11 +14,10 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "cdk-backup.template.json", - "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7617f116cb014747232d2ebeb42fb3e22242c4b0987526daf7a033aba236d976.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json index 9120c3a2895c6..3728b496ca8cf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json @@ -37,22 +37,22 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "ScalingRole": { "id": "ScalingRole", "path": "cdk-backup/Table/ScalingRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_dynamodb.Table", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "FileSystem": { @@ -63,8 +63,8 @@ "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_efs.CfnFileSystem", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Vault": { @@ -84,14 +84,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "SecondaryVault": { @@ -111,22 +111,22 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Env": { "id": "Env", "path": "cdk-backup/Env", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "ThirdVault": { @@ -156,14 +156,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Plan": { @@ -185,7 +185,6 @@ }, "ruleName": "Daily", "scheduleExpression": "cron(0 5 * * ? *)", - "scheduleExpressionTimezone": "Etc/UTC", "targetBackupVault": { "Fn::GetAtt": [ "Vault23237E5B", @@ -199,7 +198,6 @@ }, "ruleName": "Weekly", "scheduleExpression": "cron(0 5 ? * SAT *)", - "scheduleExpressionTimezone": "Etc/UTC", "targetBackupVault": { "Fn::GetAtt": [ "Vault23237E5B", @@ -214,7 +212,6 @@ }, "ruleName": "Monthly5Year", "scheduleExpression": "cron(0 5 1 * ? *)", - "scheduleExpressionTimezone": "Etc/UTC", "targetBackupVault": { "Fn::GetAtt": [ "Vault23237E5B", @@ -253,8 +250,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupPlan", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Selection": { @@ -269,8 +266,8 @@ "id": "ImportRole", "path": "cdk-backup/Plan/Selection/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Resource": { @@ -308,14 +305,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Resource": { @@ -397,42 +394,42 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupSelection", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupSelection", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupPlan", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "cdk-backup/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "cdk-backup/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Tree": { @@ -440,13 +437,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.assets.json index 30904fa397fe7..354247134c202 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.assets.json @@ -1,7 +1,7 @@ { - "version": "34.0.0", + "version": "20.0.0", "files": { - "865151155140d0ba599d3522f659db77ada497ea1a763cf11c3fb58d017a3082": { + "619c64c0f19a7d78d759641bfba47f06ebbd7ffb42aae71ec695a6777a534d01": { "source": { "path": "aws-cdk-dynamodb.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "865151155140d0ba599d3522f659db77ada497ea1a763cf11c3fb58d017a3082.json", + "objectKey": "619c64c0f19a7d78d759641bfba47f06ebbd7ffb42aae71ec695a6777a534d01.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.template.json index bd730b9100e98..72046e5747d8d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/aws-cdk-dynamodb.template.json @@ -3,16 +3,16 @@ "TableCD117FA1": { "Type": "AWS::DynamoDB::Table", "Properties": { - "AttributeDefinitions": [ + "KeySchema": [ { "AttributeName": "hashKey", - "AttributeType": "S" + "KeyType": "HASH" } ], - "KeySchema": [ + "AttributeDefinitions": [ { "AttributeName": "hashKey", - "KeyType": "HASH" + "AttributeType": "S" } ], "ProvisionedThroughput": { @@ -56,25 +56,23 @@ ] }, "ScalableDimension": "dynamodb:table:ReadCapacityUnits", + "ServiceNamespace": "dynamodb", "ScheduledActions": [ { "ScalableTargetAction": { "MinCapacity": 20 }, "Schedule": "cron(0 8 * * ? *)", - "ScheduledActionName": "ScaleUpInTheMorning", - "Timezone": "Etc/UTC" + "ScheduledActionName": "ScaleUpInTheMorning" }, { "ScalableTargetAction": { "MaxCapacity": 20 }, "Schedule": "cron(0 20 * * ? *)", - "ScheduledActionName": "ScaleDownAtNight", - "Timezone": "Etc/UTC" + "ScheduledActionName": "ScaleDownAtNight" } - ], - "ServiceNamespace": "dynamodb" + ] } }, "TableReadScalingTargetTracking67DF0596": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/cdk.out index 2313ab5436501..588d7b269d34f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/integ.json index 81c9e6f902331..8db5a6b10f544 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "20.0.0", "testCases": { "integ.autoscaling.lit": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/manifest.json index d4155ced6dcad..ceac2d72f9911 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/manifest.json @@ -1,6 +1,12 @@ { - "version": "34.0.0", + "version": "20.0.0", "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, "aws-cdk-dynamodb.assets": { "type": "cdk:asset-manifest", "properties": { @@ -14,11 +20,10 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "aws-cdk-dynamodb.template.json", - "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/865151155140d0ba599d3522f659db77ada497ea1a763cf11c3fb58d017a3082.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/619c64c0f19a7d78d759641bfba47f06ebbd7ffb42aae71ec695a6777a534d01.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -66,12 +71,6 @@ ] }, "displayName": "aws-cdk-dynamodb" - }, - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/tree.json index 07eb252a889ae..a7da46d30ce88 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.autoscaling.lit.js.snapshot/tree.json @@ -4,6 +4,14 @@ "id": "App", "path": "", "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, "aws-cdk-dynamodb": { "id": "aws-cdk-dynamodb", "path": "aws-cdk-dynamodb", @@ -18,16 +26,16 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { - "attributeDefinitions": [ + "keySchema": [ { "attributeName": "hashKey", - "attributeType": "S" + "keyType": "HASH" } ], - "keySchema": [ + "attributeDefinitions": [ { "attributeName": "hashKey", - "keyType": "HASH" + "attributeType": "S" } ], "provisionedThroughput": { @@ -37,7 +45,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable", + "fqn": "@aws-cdk/aws-dynamodb.CfnTable", "version": "0.0.0" } }, @@ -45,8 +53,8 @@ "id": "ScalingRole", "path": "aws-cdk-dynamodb/Table/ScalingRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ReadScaling": { @@ -93,11 +101,11 @@ ] }, "scalableDimension": "dynamodb:table:ReadCapacityUnits", + "serviceNamespace": "dynamodb", "scheduledActions": [ { "scheduledActionName": "ScaleUpInTheMorning", "schedule": "cron(0 8 * * ? *)", - "timezone": "Etc/UTC", "scalableTargetAction": { "minCapacity": 20 } @@ -105,17 +113,15 @@ { "scheduledActionName": "ScaleDownAtNight", "schedule": "cron(0 20 * * ? *)", - "timezone": "Etc/UTC", "scalableTargetAction": { "maxCapacity": 20 } } - ], - "serviceNamespace": "dynamodb" + ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_applicationautoscaling.CfnScalableTarget", + "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalableTarget", "version": "0.0.0" } }, @@ -143,68 +149,44 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_applicationautoscaling.CfnScalingPolicy", + "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_applicationautoscaling.TargetTrackingScalingPolicy", + "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_applicationautoscaling.ScalableTarget", + "fqn": "@aws-cdk/aws-applicationautoscaling.ScalableTarget", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_applicationautoscaling.BaseScalableAttribute", + "fqn": "@aws-cdk/aws-applicationautoscaling.BaseScalableAttribute", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_dynamodb.Table", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "aws-cdk-dynamodb/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "aws-cdk-dynamodb/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", + "fqn": "@aws-cdk/aws-dynamodb.Table", "version": "0.0.0" } } }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.assets.json index adda4ff7aab5e..784bf713b5a18 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.assets.json @@ -1,7 +1,7 @@ { "version": "34.0.0", "files": { - "54ec09132268008f855bb0ad4863af3ceda54b0640d90c386503d8faf54eeae8": { + "4e491c14be2b36af5be729715edfad23d2db6e3050125cdd632fce51b0900fb5": { "source": { "path": "aws-lambda-autoscaling.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "54ec09132268008f855bb0ad4863af3ceda54b0640d90c386503d8faf54eeae8.json", + "objectKey": "4e491c14be2b36af5be729715edfad23d2db6e3050125cdd632fce51b0900fb5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.template.json index 9da5f1d9d06f2..6ac23d677363c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/aws-lambda-autoscaling.template.json @@ -124,16 +124,14 @@ "MinCapacity": 20 }, "Schedule": "cron(0 8 * * ? *)", - "ScheduledActionName": "ScaleUpInTheMorning", - "Timezone": "Etc/UTC" + "ScheduledActionName": "ScaleUpInTheMorning" }, { "ScalableTargetAction": { "MaxCapacity": 20 }, "Schedule": "cron(0 20 * * ? *)", - "ScheduledActionName": "ScaleDownAtNight", - "Timezone": "Etc/UTC" + "ScheduledActionName": "ScaleDownAtNight" } ], "ServiceNamespace": "lambda" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/manifest.json index 4f657607872f7..20b77f5b33063 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/manifest.json @@ -14,11 +14,10 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "aws-lambda-autoscaling.template.json", - "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/54ec09132268008f855bb0ad4863af3ceda54b0640d90c386503d8faf54eeae8.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4e491c14be2b36af5be729715edfad23d2db6e3050125cdd632fce51b0900fb5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -87,6 +86,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "MyLambdaCurrentVersionE7A382CC9ef7d0f7e3b3b55a2ac4da5225352f4d": [ + { + "type": "aws:cdk:logicalId", + "data": "MyLambdaCurrentVersionE7A382CC9ef7d0f7e3b3b55a2ac4da5225352f4d", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "aws-lambda-autoscaling" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/tree.json index 7822036ae32e5..cec884fba04b0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.js.snapshot/tree.json @@ -219,7 +219,6 @@ { "scheduledActionName": "ScaleUpInTheMorning", "schedule": "cron(0 8 * * ? *)", - "timezone": "Etc/UTC", "scalableTargetAction": { "minCapacity": 20 } @@ -227,7 +226,6 @@ { "scheduledActionName": "ScaleDownAtNight", "schedule": "cron(0 20 * * ? *)", - "timezone": "Etc/UTC", "scalableTargetAction": { "maxCapacity": 20 } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json index 284398b143255..0e3a8e4816037 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json @@ -27,7 +27,7 @@ } } }, - "6efada41383a47bd56eb0a2e6091955fbf170a468c599d5b34732bcd1ba263d9": { + "23b0d2a14d3e7bc3dcf7cc5292fe80fa29dacb0aea32636c17ca9fce11d8aba9": { "source": { "path": "cdk-integ-cluster-snapshot.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6efada41383a47bd56eb0a2e6091955fbf170a468c599d5b34732bcd1ba263d9.json", + "objectKey": "23b0d2a14d3e7bc3dcf7cc5292fe80fa29dacb0aea32636c17ca9fce11d8aba9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json index 192d1f219ac85..63ac67b14613f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json @@ -426,12 +426,12 @@ "Type": "AWS::RDS::DBCluster", "Properties": { "CopyTagsToSnapshot": true, - "DBClusterParameterGroupName": "default.aurora-mysql5.7", + "DBClusterParameterGroupName": "default.aurora-mysql8.0", "DBSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, "Engine": "aurora-mysql", - "EngineVersion": "5.7.mysql_aurora.2.10.2", + "EngineVersion": "8.0.mysql_aurora.3.04.0", "MasterUserPassword": { "Fn::Join": [ "", @@ -474,7 +474,7 @@ "DBClusterIdentifier": { "Ref": "ClusterEB0386A7" }, - "DBInstanceClass": "db.t3.small", + "DBInstanceClass": "db.t3.medium", "DBSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, @@ -495,7 +495,7 @@ "DBClusterIdentifier": { "Ref": "ClusterEB0386A7" }, - "DBInstanceClass": "db.t3.small", + "DBInstanceClass": "db.t3.medium", "DBSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, @@ -1357,42 +1357,6 @@ } } }, - "FromSnapshotSecret9100F61C": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Generated by the CDK for stack: ", - { - "Ref": "AWS::StackName" - } - ] - ] - }, - "GenerateSecretString": { - "ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", - "GenerateStringKey": "password", - "PasswordLength": 30, - "SecretStringTemplate": "{\"username\":\"admin\"}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FromSnapshotSecretAttachmentB62DA1C6": { - "Type": "AWS::SecretsManager::SecretTargetAttachment", - "Properties": { - "SecretId": { - "Ref": "FromSnapshotSecret9100F61C" - }, - "TargetId": { - "Ref": "FromSnapshotEE0682C5" - }, - "TargetType": "AWS::RDS::DBCluster" - } - }, "cdkintegclustersnapshotFromSnapshotSnapshotSecretD93327943fdaad7efa858a3daf9490cf0a702aeb": { "Type": "AWS::SecretsManager::Secret", "Properties": { @@ -1486,12 +1450,12 @@ "Type": "AWS::RDS::DBCluster", "Properties": { "CopyTagsToSnapshot": true, - "DBClusterParameterGroupName": "default.aurora-mysql5.7", + "DBClusterParameterGroupName": "default.aurora-mysql8.0", "DBSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, "Engine": "aurora-mysql", - "EngineVersion": "5.7.mysql_aurora.2.10.2", + "EngineVersion": "8.0.mysql_aurora.3.04.0", "MasterUserPassword": { "Fn::Join": [ "", @@ -1528,7 +1492,7 @@ "DBClusterIdentifier": { "Ref": "FromSnapshotEE0682C5" }, - "DBInstanceClass": "db.t3.small", + "DBInstanceClass": "db.t3.medium", "DBSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, @@ -1549,7 +1513,7 @@ "DBClusterIdentifier": { "Ref": "FromSnapshotEE0682C5" }, - "DBInstanceClass": "db.t3.small", + "DBInstanceClass": "db.t3.medium", "DBSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json index c3ef0d63d6ace..456f60dd33d44 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6efada41383a47bd56eb0a2e6091955fbf170a468c599d5b34732bcd1ba263d9.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/23b0d2a14d3e7bc3dcf7cc5292fe80fa29dacb0aea32636c17ca9fce11d8aba9.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -333,18 +333,6 @@ "data": "FromSnapshotSecurityGroupfromcdkintegclustersnapshotFromSnapshotRotationSingleUserSecurityGroup8B231219IndirectPort7C6DDFDF" } ], - "/cdk-integ-cluster-snapshot/FromSnapshot/Secret/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "FromSnapshotSecret9100F61C" - } - ], - "/cdk-integ-cluster-snapshot/FromSnapshot/Secret/Attachment/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "FromSnapshotSecretAttachmentB62DA1C6" - } - ], "/cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Resource": [ { "type": "aws:cdk:logicalId", @@ -416,6 +404,24 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "FromSnapshotSecret9100F61C": [ + { + "type": "aws:cdk:logicalId", + "data": "FromSnapshotSecret9100F61C", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "FromSnapshotSecretAttachmentB62DA1C6": [ + { + "type": "aws:cdk:logicalId", + "data": "FromSnapshotSecretAttachmentB62DA1C6", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "cdk-integ-cluster-snapshot" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json index 0e549e758e4da..1671fd358b3f4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json @@ -758,12 +758,12 @@ "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", "aws:cdk:cloudformation:props": { "copyTagsToSnapshot": true, - "dbClusterParameterGroupName": "default.aurora-mysql5.7", + "dbClusterParameterGroupName": "default.aurora-mysql8.0", "dbSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, "engine": "aurora-mysql", - "engineVersion": "5.7.mysql_aurora.2.10.2", + "engineVersion": "8.0.mysql_aurora.3.04.0", "masterUsername": { "Fn::Join": [ "", @@ -820,7 +820,7 @@ "dbClusterIdentifier": { "Ref": "ClusterEB0386A7" }, - "dbInstanceClass": "db.t3.small", + "dbInstanceClass": "db.t3.medium", "dbSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, @@ -849,7 +849,7 @@ "dbClusterIdentifier": { "Ref": "ClusterEB0386A7" }, - "dbInstanceClass": "db.t3.small", + "dbInstanceClass": "db.t3.medium", "dbSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, @@ -2210,76 +2210,6 @@ "version": "0.0.0" } }, - "Secret": { - "id": "Secret", - "path": "cdk-integ-cluster-snapshot/FromSnapshot/Secret", - "children": { - "Resource": { - "id": "Resource", - "path": "cdk-integ-cluster-snapshot/FromSnapshot/Secret/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", - "aws:cdk:cloudformation:props": { - "description": { - "Fn::Join": [ - "", - [ - "Generated by the CDK for stack: ", - { - "Ref": "AWS::StackName" - } - ] - ] - }, - "generateSecretString": { - "passwordLength": 30, - "secretStringTemplate": "{\"username\":\"admin\"}", - "generateStringKey": "password", - "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret", - "version": "0.0.0" - } - }, - "Attachment": { - "id": "Attachment", - "path": "cdk-integ-cluster-snapshot/FromSnapshot/Secret/Attachment", - "children": { - "Resource": { - "id": "Resource", - "path": "cdk-integ-cluster-snapshot/FromSnapshot/Secret/Attachment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", - "aws:cdk:cloudformation:props": { - "secretId": { - "Ref": "FromSnapshotSecret9100F61C" - }, - "targetId": { - "Ref": "FromSnapshotEE0682C5" - }, - "targetType": "AWS::RDS::DBCluster" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_rds.DatabaseSecret", - "version": "0.0.0" - } - }, "SnapshotSecret": { "id": "SnapshotSecret", "path": "cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret", @@ -2446,12 +2376,12 @@ "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", "aws:cdk:cloudformation:props": { "copyTagsToSnapshot": true, - "dbClusterParameterGroupName": "default.aurora-mysql5.7", + "dbClusterParameterGroupName": "default.aurora-mysql8.0", "dbSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, "engine": "aurora-mysql", - "engineVersion": "5.7.mysql_aurora.2.10.2", + "engineVersion": "8.0.mysql_aurora.3.04.0", "masterUserPassword": { "Fn::Join": [ "", @@ -2502,7 +2432,7 @@ "dbClusterIdentifier": { "Ref": "FromSnapshotEE0682C5" }, - "dbInstanceClass": "db.t3.small", + "dbInstanceClass": "db.t3.medium", "dbSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, @@ -2531,7 +2461,7 @@ "dbClusterIdentifier": { "Ref": "FromSnapshotEE0682C5" }, - "dbInstanceClass": "db.t3.small", + "dbInstanceClass": "db.t3.medium", "dbSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.ts index ea4afa157caa4..a7619f5ff2aac 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-snapshot.ts @@ -17,11 +17,11 @@ class TestStack extends Stack { const vpc = new ec2.Vpc(this, 'Vpc', { maxAzs: 2, natGateways: 1, restrictDefaultSecurityGroup: false }); const instanceProps = { - instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM), isFromLegacyInstanceProps: true, }; const cluster = new rds.DatabaseCluster(this, 'Cluster', { - engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_10_2 }), + engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_04_0 }), writer: ClusterInstance.provisioned('Instance1', { ...instanceProps, }), @@ -42,7 +42,7 @@ class TestStack extends Stack { const fromSnapshot = new rds.DatabaseClusterFromSnapshot(this, 'FromSnapshot', { snapshotIdentifier: snapshoter.snapshotArn, snapshotCredentials: rds.SnapshotCredentials.fromGeneratedSecret('admin'), - engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_10_2 }), + engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_04_0 }), writer: ClusterInstance.provisioned('Instance1', { ...instanceProps, }), diff --git a/packages/@aws-cdk/aws-scheduler-alpha/README.md b/packages/@aws-cdk/aws-scheduler-alpha/README.md index da1e1c182d4e2..549a9f241530d 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/README.md +++ b/packages/@aws-cdk/aws-scheduler-alpha/README.md @@ -141,10 +141,10 @@ new Schedule(this, 'Schedule', { ## Scheduler Targets -The `@aws-cdk/aws-schedule-targets-alpha` module includes classes that implement the `IScheduleTarget` interface for +The `@aws-cdk/aws-scheduler-targets-alpha` module includes classes that implement the `IScheduleTarget` interface for various AWS services. EventBridge Scheduler supports two types of targets: templated targets invoke common API operations across a core groups of services, and customizeable universal targets that you can use to call more -than 6,000 operations across over 270 services. A list of supported targets can be found at `@aws-cdk/aws-schedule-targets-alpha`. +than 6,000 operations across over 270 services. A list of supported targets can be found at `@aws-cdk/aws-scheduler-targets-alpha`. ### Input diff --git a/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule-expression.ts b/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule-expression.ts index 9fa2c5165a6e9..477eee7b20659 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule-expression.ts +++ b/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule-expression.ts @@ -1,4 +1,5 @@ -import { Duration, TimeZone, Schedule, CronOptions } from 'aws-cdk-lib/core'; +import * as events from 'aws-cdk-lib/aws-events'; +import { Duration, TimeZone } from 'aws-cdk-lib/core'; /** * ScheduleExpression for EventBridge Schedule @@ -8,7 +9,7 @@ import { Duration, TimeZone, Schedule, CronOptions } from 'aws-cdk-lib/core'; * * @see https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html */ -export abstract class ScheduleExpression extends Schedule { +export abstract class ScheduleExpression { /** * Construct a one-time schedule from a date. * @@ -16,7 +17,15 @@ export abstract class ScheduleExpression extends Schedule { * @param timeZone The time zone to use for interpreting the date. Default: - UTC */ public static at(date: Date, timeZone?: TimeZone): ScheduleExpression { - return super.protectedAt(date, timeZone); + try { + const literal = date.toISOString().split('.')[0]; + return new LiteralScheduleExpression(`at(${literal})`, timeZone ?? TimeZone.ETC_UTC); + } catch (e) { + if (e instanceof RangeError) { + throw new Error('Invalid date'); + } + throw e; + } } /** @@ -25,7 +34,7 @@ export abstract class ScheduleExpression extends Schedule { * @param timeZone The time zone to use for interpreting the expression. Default: - UTC */ public static expression(expression: string, timeZone?: TimeZone): ScheduleExpression { - return super.protectedExpression(expression, timeZone); + return new LiteralScheduleExpression(expression, timeZone ?? TimeZone.ETC_UTC); } /** @@ -34,14 +43,53 @@ export abstract class ScheduleExpression extends Schedule { * Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes. */ public static rate(duration: Duration): ScheduleExpression { - return super.protectedRate(duration); + const schedule = events.Schedule.rate(duration); + return new LiteralScheduleExpression(schedule.expressionString); } /** * Create a recurring schedule from a set of cron fields and time zone. */ - public static cron(options: CronOptions): ScheduleExpression { - return super.protectedCron(options, 'aws-scheduler'); + public static cron(options: CronOptionsWithTimezone): ScheduleExpression { + const { timeZone, ...cronOptions } = options; + const schedule = events.Schedule.cron(cronOptions); + return new LiteralScheduleExpression(schedule.expressionString, timeZone); } + + /** + * Retrieve the expression for this schedule + */ + public abstract readonly expressionString: string; + + /** + * Retrieve the expression for this schedule + */ + public abstract readonly timeZone?: TimeZone; + + protected constructor() {} } +/** + * Options to configure a cron expression + * + * All fields are strings so you can use complex expressions. Absence of + * a field implies '*' or '?', whichever one is appropriate. + * + * @see https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions + */ +export interface CronOptionsWithTimezone extends events.CronOptions { + /** + * The timezone to run the schedule in + * + * @default - TimeZone.ETC_UTC + */ + readonly timeZone?: TimeZone; +} + +const DEFAULT_TIMEZONE = TimeZone.ETC_UTC; + +class LiteralScheduleExpression extends ScheduleExpression { + constructor(public readonly expressionString: string, public readonly timeZone: TimeZone = DEFAULT_TIMEZONE) { + super(); + } +} diff --git a/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule.ts b/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule.ts index 32611f99ad64e..e6d65c8c0b2fb 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule.ts +++ b/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule.ts @@ -93,7 +93,6 @@ export class Schedule extends Resource implements ISchedule { this.group = props.group; const targetConfig = props.target.bind(this); - props.schedule._bind(this); const resource = new CfnSchedule(this, 'Resource', { name: this.physicalName, diff --git a/packages/@aws-cdk/aws-scheduler-alpha/lib/target.ts b/packages/@aws-cdk/aws-scheduler-alpha/lib/target.ts index 3850f095ea04e..e15b635f7ae08 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/lib/target.ts +++ b/packages/@aws-cdk/aws-scheduler-alpha/lib/target.ts @@ -30,7 +30,7 @@ export interface ScheduleTargetConfig { readonly role: iam.IRole; /** - * What input to pass to the target + * What input to pass to the tatget */ readonly input?: ScheduleTargetInput; diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json index 78b01562c3813..2a26ac17ddebd 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json +++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json @@ -1,7 +1,7 @@ { "version": "34.0.0", "files": { - "bbcd00ec8f22ebae1e8018bdae1226dbbdf643fd8c5453daf208abedd325db6c": { + "8e518d2f0d7b4fcf41623a37d5a30fa0a49f5185d9301205cad6e72cc59b84a8": { "source": { "path": "aws-cdk-scheduler-schedule.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "bbcd00ec8f22ebae1e8018bdae1226dbbdf643fd8c5453daf208abedd325db6c.json", + "objectKey": "8e518d2f0d7b4fcf41623a37d5a30fa0a49f5185d9301205cad6e72cc59b84a8.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.template.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.template.json index 2042d17cbd10b..59e00cc6402db 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.template.json +++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.template.json @@ -74,6 +74,7 @@ "Mode": "OFF" }, "ScheduleExpression": "rate(12 hours)", + "ScheduleExpressionTimezone": "Etc/UTC", "State": "ENABLED", "Target": { "Arn": { @@ -98,6 +99,7 @@ "Mode": "OFF" }, "ScheduleExpression": "rate(12 hours)", + "ScheduleExpressionTimezone": "Etc/UTC", "State": "DISABLED", "Target": { "Arn": { diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json index 2dc25c77fa582..0bbde393e24c3 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bbcd00ec8f22ebae1e8018bdae1226dbbdf643fd8c5453daf208abedd325db6c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8e518d2f0d7b4fcf41623a37d5a30fa0a49f5185d9301205cad6e72cc59b84a8.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json index ede00d1d0df84..db604f9e73761 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json @@ -156,6 +156,7 @@ "mode": "OFF" }, "scheduleExpression": "rate(12 hours)", + "scheduleExpressionTimezone": "Etc/UTC", "state": "ENABLED", "target": { "arn": { @@ -198,6 +199,7 @@ "mode": "OFF" }, "scheduleExpression": "rate(12 hours)", + "scheduleExpressionTimezone": "Etc/UTC", "state": "DISABLED", "target": { "arn": { diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/schedule-expression.test.ts b/packages/@aws-cdk/aws-scheduler-alpha/test/schedule-expression.test.ts index 6f71558c1a704..d12ca608820d3 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/test/schedule-expression.test.ts +++ b/packages/@aws-cdk/aws-scheduler-alpha/test/schedule-expression.test.ts @@ -28,23 +28,20 @@ describe('schedule expression', () => { }); test('cron expressions saves timezone', () => { - // GIVEN - const cron = ScheduleExpression.cron({ - minute: '0', - hour: '10', - timeZone: TimeZone.EUROPE_LONDON, - }); - cron._bind(new Stack()); - - // THEN - expect(cron.timeZone).toEqual(TimeZone.EUROPE_LONDON); + expect(TimeZone.EUROPE_LONDON).toEqual(ScheduleExpression.cron( + { + minute: '0', + hour: '10', + timeZone: TimeZone.EUROPE_LONDON, + }).timeZone); }); test('cron expressions timezone is UTC if not specified', () => { - expect(ScheduleExpression.cron({ - minute: '0', - hour: '10', - }).timeZone).toEqual(TimeZone.ETC_UTC); + expect(TimeZone.ETC_UTC).toEqual(ScheduleExpression.cron( + { + minute: '0', + hour: '10', + }).timeZone); }); test('rate cannot be 0', () => { diff --git a/packages/@aws-cdk/aws-synthetics-alpha/lib/schedule.ts b/packages/@aws-cdk/aws-synthetics-alpha/lib/schedule.ts index 1d2aa9b88ea67..7be04de89fab3 100644 --- a/packages/@aws-cdk/aws-synthetics-alpha/lib/schedule.ts +++ b/packages/@aws-cdk/aws-synthetics-alpha/lib/schedule.ts @@ -1,10 +1,9 @@ -import { Duration, Schedule as CoreSchedule } from 'aws-cdk-lib/core'; -import { Construct } from 'constructs'; +import { Duration } from 'aws-cdk-lib/core'; /** * Schedule for canary runs */ -export class Schedule extends CoreSchedule { +export class Schedule { /** * The canary will be executed once. @@ -37,27 +36,39 @@ export class Schedule extends CoreSchedule { if (minutes === 0) { return Schedule.once(); } - return super.protectedRate(interval); + if (minutes === 1) { + return new Schedule('rate(1 minute)'); + } + return new Schedule(`rate(${minutes} minutes)`); } /** * Create a schedule from a set of cron fields */ public static cron(options: CronOptions): Schedule { - return super.protectedCron({ - ...options, - year: '*', // '*' is the only allowed value in the year field - }, 'aws-synthetics'); - } + if (options.weekDay !== undefined && options.day !== undefined) { + throw new Error('Cannot supply both \'day\' and \'weekDay\', use at most one'); + } + + const minute = fallback(options.minute, '*'); + const hour = fallback(options.hour, '*'); + const month = fallback(options.month, '*'); + + // Weekday defaults to '?' if not supplied. If it is supplied, day must become '?' + const day = fallback(options.day, options.weekDay !== undefined ? '?' : '*'); + const weekDay = fallback(options.weekDay, '?'); - private constructor(public readonly expressionString: string) { - super(); + // '*' is only allowed in the year field + const year = '*'; + + return new Schedule(`cron(${minute} ${hour} ${day} ${month} ${weekDay} ${year})`); } - /** - * @internal - */ - public _bind(_scope: Construct) {} + private constructor( + /** + * The Schedule expression + */ + public readonly expressionString: string) {} } /** @@ -104,3 +115,7 @@ export interface CronOptions { */ readonly weekDay?: string; } + +function fallback(x: string | undefined, def: string): string { + return x ?? def; +} diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index d32a46743e268..7004c5ec5e873 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -59,6 +59,8 @@ Flags come in three types: | [@aws-cdk/aws-efs:denyAnonymousAccess](#aws-cdkaws-efsdenyanonymousaccess) | EFS denies anonymous clients accesses | 2.93.0 | (default) | | [@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId](#aws-cdkaws-efsmounttargetorderinsensitivelogicalid) | When enabled, mount targets will have a stable logicalId that is linked to the associated subnet. | 2.93.0 | (fix) | | [@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion](#aws-cdkaws-lambda-nodejsuselatestruntimeversion) | Enables aws-lambda-nodejs.Function to use the latest available NodeJs runtime as the default | 2.93.0 | (default) | +| [@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier](#aws-cdkaws-appsyncusearnforsourceapiassociationidentifier) | When enabled, will always use the arn for identifiers for CfnSourceApiAssociation in the GraphqlApi construct rather than id. | 2.97.0 | (fix) | +| [@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters](#aws-cdkaws-rdsauroraclusterchangescopeofinstanceparametergroupwitheachparameters) | When enabled, a scope of InstanceParameterGroup for AuroraClusterInstance with each parameters will change. | 2.97.0 | (fix) | @@ -108,7 +110,9 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-efs:denyAnonymousAccess": true, "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true, "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true, - "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true + "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true, + "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true, + "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true } } ``` @@ -1113,4 +1117,37 @@ shipped as part of the runtime environment. **Compatibility with old behavior:** Pass `runtime: lambda.Runtime.NODEJS_16_X` to `Function` construct to restore the previous behavior. +### @aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier + +*When enabled, will always use the arn for identifiers for CfnSourceApiAssociation in the GraphqlApi construct rather than id.* (fix) + +When this feature flag is enabled, we use the IGraphqlApi ARN rather than ID when creating or updating CfnSourceApiAssociation in +the GraphqlApi construct. Using the ARN allows the association to support an association with a source api or merged api in another account. +Note that for existing source api associations created with this flag disabled, enabling the flag will lead to a resource replacement. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| 2.97.0 | `false` | `true` | + + +### @aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters + +*When enabled, a scope of InstanceParameterGroup for AuroraClusterInstance with each parameters will change.* (fix) + +When this feature flag is enabled, a scope of `InstanceParameterGroup` for +`AuroraClusterInstance` with each parameters will change to AuroraClusterInstance +from AuroraCluster. + +If the flag is set to false then it can only make one `AuroraClusterInstance` +with each `InstanceParameterGroup` in the AuroraCluster. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| 2.97.0 | `false` | `true` | + + diff --git a/packages/aws-cdk-lib/aws-applicationautoscaling/README.md b/packages/aws-cdk-lib/aws-applicationautoscaling/README.md index c729bd27b704e..6bc05ee9882f2 100644 --- a/packages/aws-cdk-lib/aws-applicationautoscaling/README.md +++ b/packages/aws-cdk-lib/aws-applicationautoscaling/README.md @@ -191,7 +191,7 @@ capacity.scaleOnSchedule('PrescaleInTheMorning', { capacity.scaleOnSchedule('AllowDownscalingAtNight', { schedule: appscaling.Schedule.cron({ hour: '20', minute: '0' }), - minCapacity: 1, + minCapacity: 1 }); ``` @@ -220,12 +220,12 @@ const target = new appscaling.ScalableTarget(this, 'ScalableTarget', { minCapacity: 10, resourceId: `function:${handler.functionName}:${fnVer.version}`, scalableDimension: 'lambda:function:ProvisionedConcurrency', -}); +}) target.scaleToTrackMetric('PceTracking', { targetValue: 0.9, predefinedMetric: appscaling.PredefinedMetric.LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION, -}); +}) ``` ### ElastiCache Redis shards scaling with target value diff --git a/packages/aws-cdk-lib/aws-applicationautoscaling/lib/scalable-target.ts b/packages/aws-cdk-lib/aws-applicationautoscaling/lib/scalable-target.ts index 4f4dee7696fc8..0e825bce03d19 100644 --- a/packages/aws-cdk-lib/aws-applicationautoscaling/lib/scalable-target.ts +++ b/packages/aws-cdk-lib/aws-applicationautoscaling/lib/scalable-target.ts @@ -155,7 +155,6 @@ export class ScalableTarget extends Resource implements IScalableTarget { this.actions.push({ scheduledActionName: id, schedule: action.schedule.expressionString, - timezone: action.schedule.timeZone?.timezoneName, startTime: action.startTime, endTime: action.endTime, scalableTargetAction: { diff --git a/packages/aws-cdk-lib/aws-applicationautoscaling/lib/schedule.ts b/packages/aws-cdk-lib/aws-applicationautoscaling/lib/schedule.ts index 3954b0a81efaf..82c73291993ed 100644 --- a/packages/aws-cdk-lib/aws-applicationautoscaling/lib/schedule.ts +++ b/packages/aws-cdk-lib/aws-applicationautoscaling/lib/schedule.ts @@ -1,38 +1,87 @@ -import { Duration, TimeZone, CronOptions as CoreCronOptions, Schedule as CoreSchedule } from '../../core'; +import { Construct } from 'constructs'; +import { Annotations, Duration } from '../../core'; /** * Schedule for scheduled scaling actions */ -export abstract class Schedule extends CoreSchedule { +export abstract class Schedule { /** * Construct a schedule from a literal schedule expression * * @param expression The expression to use. Must be in a format that Application AutoScaling will recognize */ - public static expression(expression: string, timeZone?: TimeZone): Schedule { - return super.protectedExpression(expression, timeZone); + public static expression(expression: string): Schedule { + return new LiteralSchedule(expression); } /** - * Construct a schedule from an interval and a time unit. Must be a whole number of seconds. + * Construct a schedule from an interval and a time unit */ public static rate(duration: Duration): Schedule { - return super.protectedRate(duration); + if (duration.isUnresolved()) { + const validDurationUnit = ['minute', 'minutes', 'hour', 'hours', 'day', 'days']; + if (!validDurationUnit.includes(duration.unitLabel())) { + throw new Error("Allowed units for scheduling are: 'minute', 'minutes', 'hour', 'hours', 'day' or 'days'"); + } + return new LiteralSchedule(`rate(${duration.formatTokenToNumber()})`); + } + if (duration.toSeconds() === 0) { + throw new Error('Duration cannot be 0'); + } + + let rate = maybeRate(duration.toDays({ integral: false }), 'day'); + if (rate === undefined) { rate = maybeRate(duration.toHours({ integral: false }), 'hour'); } + if (rate === undefined) { rate = makeRate(duration.toMinutes({ integral: true }), 'minute'); } + return new LiteralSchedule(rate); } /** * Construct a Schedule from a moment in time */ - public static at(moment: Date, timeZone?: TimeZone): Schedule { - return super.protectedAt(moment, timeZone); + public static at(moment: Date): Schedule { + return new LiteralSchedule(`at(${formatISO(moment)})`); } /** * Create a schedule from a set of cron fields */ - public static cron(options: CoreCronOptions): Schedule { - return super.protectedCron(options, 'aws-applicationautoscaling'); + public static cron(options: CronOptions): Schedule { + if (options.weekDay !== undefined && options.day !== undefined) { + throw new Error('Cannot supply both \'day\' and \'weekDay\', use at most one'); + } + + const minute = fallback(options.minute, '*'); + const hour = fallback(options.hour, '*'); + const month = fallback(options.month, '*'); + const year = fallback(options.year, '*'); + + // Weekday defaults to '?' if not supplied. If it is supplied, day must become '?' + const day = fallback(options.day, options.weekDay !== undefined ? '?' : '*'); + const weekDay = fallback(options.weekDay, '?'); + + return new class extends Schedule { + public readonly expressionString: string = `cron(${minute} ${hour} ${day} ${month} ${weekDay} ${year})`; + public _bind(scope: Construct) { + if (!options.minute) { + Annotations.of(scope).addWarningV2('@aws-cdk/aws-applicationautoscaling:defaultRunEveryMinute', 'cron: If you don\'t pass \'minute\', by default the event runs every minute. Pass \'minute: \'*\'\' if that\'s what you intend, or \'minute: 0\' to run once per hour instead.'); + } + return new LiteralSchedule(this.expressionString); + } + }; } + + /** + * Retrieve the expression for this schedule + */ + public abstract readonly expressionString: string; + + protected constructor() {} + + /** + * + * @internal + */ + public abstract _bind(scope: Construct): void; } /** @@ -42,6 +91,92 @@ export abstract class Schedule extends CoreSchedule { * a field implies '*' or '?', whichever one is appropriate. * * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions - * @deprecated use core.CronOptions instead */ -export interface CronOptions extends CoreCronOptions {} +export interface CronOptions { + /** + * The minute to run this rule at + * + * @default - Every minute + */ + readonly minute?: string; + + /** + * The hour to run this rule at + * + * @default - Every hour + */ + readonly hour?: string; + + /** + * The day of the month to run this rule at + * + * @default - Every day of the month + */ + readonly day?: string; + + /** + * The month to run this rule at + * + * @default - Every month + */ + readonly month?: string; + + /** + * The year to run this rule at + * + * @default - Every year + */ + readonly year?: string; + + /** + * The day of the week to run this rule at + * + * @default - Any day of the week + */ + readonly weekDay?: string; +} + +class LiteralSchedule extends Schedule { + constructor(public readonly expressionString: string) { + super(); + } + + public _bind() {} +} + +function fallback(x: T | undefined, def: T): T { + return x === undefined ? def : x; +} + +function formatISO(date?: Date) { + if (!date) { return undefined; } + + return date.getUTCFullYear() + + '-' + pad(date.getUTCMonth() + 1) + + '-' + pad(date.getUTCDate()) + + 'T' + pad(date.getUTCHours()) + + ':' + pad(date.getUTCMinutes()) + + ':' + pad(date.getUTCSeconds()); + + function pad(num: number) { + if (num < 10) { + return '0' + num; + } + return num; + } +} + +/** + * Return the rate if the rate is whole number + */ +function maybeRate(interval: number, singular: string) { + if (interval === 0 || !Number.isInteger(interval)) { return undefined; } + return makeRate(interval, singular); +} + +/** + * Return 'rate(${interval} ${singular}(s))` for the interval + */ +function makeRate(interval: number, singular: string) { + return interval === 1 ? `rate(1 ${singular})` : `rate(${interval} ${singular}s)`; +} diff --git a/packages/aws-cdk-lib/aws-applicationautoscaling/test/schedule.test.ts b/packages/aws-cdk-lib/aws-applicationautoscaling/test/schedule.test.ts index 59e597522f007..86d4d06c8cae6 100644 --- a/packages/aws-cdk-lib/aws-applicationautoscaling/test/schedule.test.ts +++ b/packages/aws-cdk-lib/aws-applicationautoscaling/test/schedule.test.ts @@ -1,17 +1,15 @@ -import { Duration, Stack, Lazy, TimeZone } from '../../core'; +import { Duration, Stack, Lazy } from '../../core'; import * as appscaling from '../lib'; describe('cron', () => { test('test utc cron, hour only', () => { expect(appscaling.Schedule.cron({ hour: '18', minute: '0' }).expressionString).toEqual('cron(0 18 * * ? *)'); + }); test('test utc cron, hour and minute', () => { expect(appscaling.Schedule.cron({ hour: '18', minute: '24' }).expressionString).toEqual('cron(24 18 * * ? *)'); - }); - test('test europe/london cron', () => { - expect(appscaling.Schedule.cron({ hour: '18', minute: '0', timeZone: TimeZone.EUROPE_LONDON }).timeZone?.timezoneName).toEqual('Europe/London'); }); }); @@ -19,24 +17,28 @@ describe('rate', () => { test('rate must be whole number of minutes', () => { expect(() => { appscaling.Schedule.rate(Duration.minutes(0.13456)); - }).toThrow(/0.13456 must be a whole number of minutes/); + }).toThrow(/'0.13456 minutes' cannot be converted into a whole number of seconds/); + }); test('rate can be in seconds', () => { const duration = appscaling.Schedule.rate(Duration.seconds(120)); expect('rate(2 minutes)').toEqual(duration.expressionString); + }); test('rate must not be in seconds when specified as a token', () => { expect(() => { appscaling.Schedule.rate(Duration.seconds(Lazy.number({ produce: () => 5 }))); }).toThrow(/Allowed units for scheduling/); + }); test('rate cannot be 0', () => { expect(() => { appscaling.Schedule.rate(Duration.days(0)); }).toThrow(/Duration cannot be 0/); + }); test('rate can be token', () => { @@ -44,17 +46,20 @@ describe('rate', () => { const lazyDuration = Duration.minutes(Lazy.number({ produce: () => 5 })); const rate = appscaling.Schedule.rate(lazyDuration); expect('rate(5 minutes)').toEqual(stack.resolve(rate).expressionString); + }); test('rate can be in allowed type hours', () => { expect('rate(1 hour)').toEqual(appscaling.Schedule.rate(Duration.hours(1)) .expressionString); + }); }); describe('expression', () => { test('test using a literal schedule expression', () => { expect(appscaling.Schedule.expression('cron(0 18 * * ? *)').expressionString).toEqual('cron(0 18 * * ? *)'); + }); }); diff --git a/packages/aws-cdk-lib/aws-autoscaling/README.md b/packages/aws-cdk-lib/aws-autoscaling/README.md index 4dacd47f1baa2..4fbbafe1a6bc6 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/README.md +++ b/packages/aws-cdk-lib/aws-autoscaling/README.md @@ -284,7 +284,7 @@ autoScalingGroup.scaleOnSchedule('PrescaleInTheMorning', { autoScalingGroup.scaleOnSchedule('AllowDownscalingAtNight', { schedule: autoscaling.Schedule.cron({ hour: '20', minute: '0' }), - minCapacity: 1, + minCapacity: 1 }); ``` diff --git a/packages/aws-cdk-lib/aws-autoscaling/lib/schedule.ts b/packages/aws-cdk-lib/aws-autoscaling/lib/schedule.ts index 79cc02545b5d9..7f532e65ac62a 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/lib/schedule.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/lib/schedule.ts @@ -1,44 +1,57 @@ import { Construct } from 'constructs'; -import { Annotations, CronOptions as CoreCronOptions, Schedule as CoreSchedule, TimeZone } from '../../core'; +import { Annotations } from '../../core'; /** * Schedule for scheduled scaling actions */ -export abstract class Schedule extends CoreSchedule { +export abstract class Schedule { /** * Construct a schedule from a literal schedule expression * * @param expression The expression to use. Must be in a format that AutoScaling will recognize * @see http://crontab.org/ */ - public static expression(expression: string, timeZone?: TimeZone): Schedule { - return super.protectedExpression(expression, timeZone); + public static expression(expression: string): Schedule { + return new LiteralSchedule(expression); } /** * Create a schedule from a set of cron fields */ - public static cron(options: CoreCronOptions): Schedule { - const cron = super.protectedCron({ - weekDay: '*', // to override core.Schedule's default - day: '*', // to override core.Schedule's default - ...options, - }); - const cronSplit = cron.expressionString.slice(5).split(' '); // remove "cron(" from start - cronSplit.pop(); // remove year, since autoscaling does not accept it - const autoscalingCron = cronSplit.join(' '); + public static cron(options: CronOptions): Schedule { + if (options.weekDay !== undefined && options.day !== undefined) { + throw new Error('Cannot supply both \'day\' and \'weekDay\', use at most one'); + } + + const minute = fallback(options.minute, '*'); + const hour = fallback(options.hour, '*'); + const month = fallback(options.month, '*'); + const day = fallback(options.day, '*'); + const weekDay = fallback(options.weekDay, '*'); return new class extends Schedule { - public readonly expressionString = autoscalingCron; - public readonly timeZone = options.timeZone; + public readonly expressionString: string = `${minute} ${hour} ${day} ${month} ${weekDay}`; public _bind(scope: Construct) { if (!options.minute) { Annotations.of(scope).addWarningV2('@aws-cdk/aws-autoscaling:scheduleDefaultRunsEveryMinute', 'cron: If you don\'t pass \'minute\', by default the event runs every minute. Pass \'minute: \'*\'\' if that\'s what you intend, or \'minute: 0\' to run once per hour instead.'); } - return Schedule.expression(this.expressionString, this.timeZone); + return new LiteralSchedule(this.expressionString); } }; } + + /** + * Retrieve the expression for this schedule + */ + public abstract readonly expressionString: string; + + protected constructor() {} + + /** + * + * @internal + */ + public abstract _bind(scope: Construct): void; } /** @@ -48,6 +61,52 @@ export abstract class Schedule extends CoreSchedule { * a field implies '*' or '?', whichever one is appropriate. * * @see http://crontab.org/ - * @deprecated use core.CronOptions */ -export interface CronOptions extends CoreCronOptions {} +export interface CronOptions { + /** + * The minute to run this rule at + * + * @default - Every minute + */ + readonly minute?: string; + + /** + * The hour to run this rule at + * + * @default - Every hour + */ + readonly hour?: string; + + /** + * The day of the month to run this rule at + * + * @default - Every day of the month + */ + readonly day?: string; + + /** + * The month to run this rule at + * + * @default - Every month + */ + readonly month?: string; + + /** + * The day of the week to run this rule at + * + * @default - Any day of the week + */ + readonly weekDay?: string; +} + +class LiteralSchedule extends Schedule { + constructor(public readonly expressionString: string) { + super(); + } + + public _bind(): void {} +} + +function fallback(x: T | undefined, def: T): T { + return x === undefined ? def : x; +} diff --git a/packages/aws-cdk-lib/aws-autoscaling/lib/scheduled-action.ts b/packages/aws-cdk-lib/aws-autoscaling/lib/scheduled-action.ts index 468b4027dcd20..84b2d55f63b1d 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/lib/scheduled-action.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/lib/scheduled-action.ts @@ -16,11 +16,9 @@ export interface BasicScheduledActionProps { * For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. * * @default - UTC - * @deprecated use time zones as part of the schedule prop * */ readonly timeZone?: string; - /** * When to perform this action. * @@ -106,10 +104,6 @@ export class ScheduledAction extends Resource { throw new Error('At least one of minCapacity, maxCapacity, or desiredCapacity is required'); } - if (props.timeZone && props.schedule.timeZone) { - throw new Error('Cannot set `timeZone` property and `schedule` property with time zone defined. Please remove the deprecated `timeZone` property.'); - } - // add a warning on synth when minute is not defined in a cron schedule props.schedule._bind(this); @@ -121,7 +115,7 @@ export class ScheduledAction extends Resource { maxSize: props.maxCapacity, desiredCapacity: props.desiredCapacity, recurrence: props.schedule.expressionString, - timeZone: props.schedule.timeZone?.timezoneName ?? props.timeZone, + timeZone: props.timeZone, }); this.scheduledActionName = resource.attrScheduledActionName; diff --git a/packages/aws-cdk-lib/aws-autoscaling/test/scheduled-action.test.ts b/packages/aws-cdk-lib/aws-autoscaling/test/scheduled-action.test.ts index 33fb769a47d15..943939c09febb 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/test/scheduled-action.test.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/test/scheduled-action.test.ts @@ -62,42 +62,6 @@ describeDeprecated('scheduled action', () => { }); }); - test('set timezone as part of schedule', () => { - // GIVEN - const stack = new cdk.Stack(); - const asg = makeAutoScalingGroup(stack); - - // WHEN - asg.scaleOnSchedule('ScaleOutAtMiddaySeoul', { - schedule: autoscaling.Schedule.expression('0 12 * * *', cdk.TimeZone.ASIA_SEOUL), - minCapacity: 12, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::AutoScaling::ScheduledAction', { - MinSize: 12, - Recurrence: '0 12 * * *', - TimeZone: 'Asia/Seoul', - }); - }); - - test('throws when timezone and scheduled timezone set together', () => { - // GIVEN - const stack = new cdk.Stack(); - const asg = makeAutoScalingGroup(stack); - - // THEN - expect(() => asg.scaleOnSchedule('ScaleOutAtMiddaySeoul', { - schedule: autoscaling.Schedule.cron({ - hour: '12', - minute: '0', - timeZone: cdk.TimeZone.ASIA_SEOUL, - }), - minCapacity: 12, - timeZone: 'Asia/Seoul', - })).toThrowError(/Please remove the deprecated `timeZone` property./); - }); - test('autoscaling group has recommended updatepolicy for scheduled actions', () => { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/aws-cdk-lib/aws-backup/README.md b/packages/aws-cdk-lib/aws-backup/README.md index fe2abaae5608d..27b2fcc3667f1 100644 --- a/packages/aws-cdk-lib/aws-backup/README.md +++ b/packages/aws-cdk-lib/aws-backup/README.md @@ -8,10 +8,10 @@ configure backup policies and monitor backup activity for your AWS resources in ## Backup plan and selection In AWS Backup, a *backup plan* is a policy expression that defines when and how you want to back up -your AWS resources, such as Amazon DynamoDB tables or Amazon Elastic File System (Amazon EFS) file -systems. You can assign resources to backup plans, and AWS Backup automatically backs up and retains -backups for those resources according to the backup plan. You can create multiple backup plans if you -have workloads with different backup requirements. + your AWS resources, such as Amazon DynamoDB tables or Amazon Elastic File System (Amazon EFS) file + systems. You can assign resources to backup plans, and AWS Backup automatically backs up and retains + backups for those resources according to the backup plan. You can create multiple backup plans if you + have workloads with different backup requirements. This module provides ready-made backup plans (similar to the console experience): @@ -52,8 +52,8 @@ plan.addSelection('Selection', { backup.BackupResource.fromRdsServerlessCluster(myServerlessCluster), // An Aurora Serverless cluster backup.BackupResource.fromTag('stage', 'prod'), // All resources that are tagged stage=prod in the region/account backup.BackupResource.fromConstruct(myCoolConstruct), // All backupable resources in `myCoolConstruct` - ], -}); + ] +}) ``` If not specified, a new IAM role with a managed policy for backup will be @@ -66,7 +66,7 @@ declare const plan: backup.BackupPlan; plan.addRule(new backup.BackupPlanRule({ completionWindow: Duration.hours(2), startWindow: Duration.hours(1), - schedule: backup.Schedule.cron({ // Only cron expressions are supported + scheduleExpression: events.Schedule.cron({ // Only cron expressions are supported day: '15', hour: '3', minute: '30', @@ -100,7 +100,7 @@ plan.addRule(new backup.BackupPlanRule({ destinationBackupVault: secondaryVault, moveToColdStorageAfter: Duration.days(30), deleteAfter: Duration.days(120), - }], + }] })); ``` @@ -193,7 +193,7 @@ const vault = new backup.BackupVault(this, 'Vault', { }), ], }), -}); +}) ``` Alternativately statements can be added to the vault policy using `addToAccessPolicy()`. diff --git a/packages/aws-cdk-lib/aws-backup/lib/index.ts b/packages/aws-cdk-lib/aws-backup/lib/index.ts index 2e6094022a9e1..7b34df14d75df 100644 --- a/packages/aws-cdk-lib/aws-backup/lib/index.ts +++ b/packages/aws-cdk-lib/aws-backup/lib/index.ts @@ -3,7 +3,6 @@ export * from './plan'; export * from './rule'; export * from './selection'; export * from './resource'; -export * from './schedule'; // AWS::Backup CloudFormation Resources: export * from './backup.generated'; diff --git a/packages/aws-cdk-lib/aws-backup/lib/plan.ts b/packages/aws-cdk-lib/aws-backup/lib/plan.ts index 96789462488c5..a7ce167ac92ea 100644 --- a/packages/aws-cdk-lib/aws-backup/lib/plan.ts +++ b/packages/aws-cdk-lib/aws-backup/lib/plan.ts @@ -187,8 +187,7 @@ export class BackupPlan extends Resource implements IBackupPlan { moveToColdStorageAfterDays: rule.props.moveToColdStorageAfter?.toDays(), }, ruleName: rule.props.ruleName ?? `${this.node.id}Rule${this.rules.length}`, - scheduleExpression: rule.props.schedule?.expressionString ?? rule.props.scheduleExpression?.expressionString, - scheduleExpressionTimezone: rule.props.schedule?.timeZone?.timezoneName, + scheduleExpression: rule.props.scheduleExpression?.expressionString, startWindowMinutes: rule.props.startWindow?.toMinutes(), enableContinuousBackup: rule.props.enableContinuousBackup, targetBackupVault: vault.backupVaultName, diff --git a/packages/aws-cdk-lib/aws-backup/lib/rule.ts b/packages/aws-cdk-lib/aws-backup/lib/rule.ts index 30591c29735c3..566f1edbde1ac 100644 --- a/packages/aws-cdk-lib/aws-backup/lib/rule.ts +++ b/packages/aws-cdk-lib/aws-backup/lib/rule.ts @@ -1,4 +1,3 @@ -import { Schedule } from './schedule'; import { IBackupVault } from './vault'; import * as events from '../../aws-events'; import { Duration, Token } from '../../core'; @@ -42,17 +41,9 @@ export interface BackupPlanRuleProps { * A CRON expression specifying when AWS Backup initiates a backup job. * * @default - no schedule - * @deprecated use schedule prop instead */ readonly scheduleExpression?: events.Schedule; - /** - * A CRON expression specifying when AWS Backup initiates a backup job. - * - * @default - no schedule - */ - readonly schedule?: Schedule; - /** * The duration after a backup is scheduled before a job is canceled if it doesn't start successfully. * @@ -131,7 +122,7 @@ export class BackupPlanRule { return new BackupPlanRule({ backupVault, ruleName: 'Daily', - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ hour: '5', minute: '0', }), @@ -146,7 +137,7 @@ export class BackupPlanRule { return new BackupPlanRule({ backupVault, ruleName: 'Weekly', - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ hour: '5', minute: '0', weekDay: 'SAT', @@ -162,7 +153,7 @@ export class BackupPlanRule { return new BackupPlanRule({ backupVault, ruleName: 'Monthly1Year', - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ day: '1', hour: '5', minute: '0', @@ -179,7 +170,7 @@ export class BackupPlanRule { return new BackupPlanRule({ backupVault, ruleName: 'Monthly5Year', - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ day: '1', hour: '5', minute: '0', @@ -196,7 +187,7 @@ export class BackupPlanRule { return new BackupPlanRule({ backupVault, ruleName: 'Monthly7Year', - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ day: '1', hour: '5', minute: '0', @@ -209,7 +200,7 @@ export class BackupPlanRule { /** * Properties of BackupPlanRule */ - public readonly props: BackupPlanRuleProps; + public readonly props: BackupPlanRuleProps /** @param props Rule properties */ constructor(props: BackupPlanRuleProps) { @@ -222,10 +213,6 @@ export class BackupPlanRule { throw new Error('`scheduleExpression` must be of type `cron`'); } - if (props.schedule && props.scheduleExpression) { - throw new Error('Cannot specify `schedule` and `scheduleExpression` together. Please use `schedule` only.'); - } - const deleteAfter = (props.enableContinuousBackup && !props.deleteAfter) ? Duration.days(35) : props.deleteAfter; if (props.enableContinuousBackup && props.moveToColdStorageAfter) { diff --git a/packages/aws-cdk-lib/aws-backup/lib/schedule.ts b/packages/aws-cdk-lib/aws-backup/lib/schedule.ts deleted file mode 100644 index 25c38df03b52e..0000000000000 --- a/packages/aws-cdk-lib/aws-backup/lib/schedule.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CronOptions, Schedule as CoreSchedule, TimeZone } from '../../core'; - -export abstract class Schedule extends CoreSchedule { - /** - * Construct a schedule from a literal schedule expression - * - * @param expression The expression to use. Must be in a format that AWS Backup will recognize - */ - public static expression(expression: string, timeZone?: TimeZone): Schedule { - return super.protectedExpression(expression, timeZone); - } - - /** - * Construct a schedule from cron options - */ - public static cron(options: CronOptions): Schedule { - return super.protectedCron(options, 'aws-backup'); - } -} diff --git a/packages/aws-cdk-lib/aws-backup/test/plan.test.ts b/packages/aws-cdk-lib/aws-backup/test/plan.test.ts index 3adb1b5e50c2b..4d9c23700d651 100644 --- a/packages/aws-cdk-lib/aws-backup/test/plan.test.ts +++ b/packages/aws-cdk-lib/aws-backup/test/plan.test.ts @@ -1,8 +1,7 @@ -import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import { Template } from '../../assertions'; import * as events from '../../aws-events'; import { App, Duration, Stack } from '../../core'; -import { BackupPlan, BackupPlanRule, BackupVault, Schedule } from '../lib'; +import { BackupPlan, BackupPlanRule, BackupVault } from '../lib'; let stack: Stack; beforeEach(() => { @@ -21,7 +20,7 @@ test('create a plan and add rules', () => { new BackupPlanRule({ completionWindow: Duration.hours(2), startWindow: Duration.hours(1), - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ day: '15', hour: '3', minute: '30', @@ -158,7 +157,7 @@ test('create a plan and add rules - add BackupPlan.AdvancedBackupSettings.Backup new BackupPlanRule({ completionWindow: Duration.hours(2), startWindow: Duration.hours(1), - schedule: Schedule.cron({ + scheduleExpression: events.Schedule.cron({ day: '15', hour: '3', minute: '30', @@ -381,19 +380,12 @@ test('throws when deleteAfter is not greater than moveToColdStorageAfter', () => })).toThrow(/`deleteAfter` must be greater than `moveToColdStorageAfter`/); }); -testDeprecated('throws when scheduleExpression is not of type cron', () => { +test('throws when scheduleExpression is not of type cron', () => { expect(() => new BackupPlanRule({ scheduleExpression: events.Schedule.rate(Duration.hours(5)), })).toThrow(/`scheduleExpression` must be of type `cron`/); }); -testDeprecated('throws when schedule and scheduleExpression are both set', () => { - expect(() => new BackupPlanRule({ - schedule: Schedule.cron({ day: '* ' }), - scheduleExpression: events.Schedule.cron({ day: '?' }), - })).toThrow(/Please use `schedule` only./); -}); - test('synth fails when plan has no rules', () => { // GIVEN const app = new App(); diff --git a/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts b/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts index a92ccb0473df4..edab404c22f61 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts @@ -1548,7 +1548,7 @@ test('scheduled scaling shows warning when minute is not defined in cron', () => }); // THEN - Annotations.fromStack(stack).hasWarning('/Default/MyTable/ReadScaling/Target', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-applicationautoscaling:scheduleDefaultRunsEveryMinute]"); + Annotations.fromStack(stack).hasWarning('/Default/MyTable/ReadScaling/Target', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-applicationautoscaling:defaultRunEveryMinute]"); }); test('scheduled scaling shows no warning when minute is * in cron', () => { diff --git a/packages/aws-cdk-lib/aws-ec2/lib/cfn-init.ts b/packages/aws-cdk-lib/aws-ec2/lib/cfn-init.ts index 5abcbc35fb926..2cd6fd24f0c8b 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/cfn-init.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/cfn-init.ts @@ -303,6 +303,10 @@ function deepMerge(target?: Record, src?: Record) { if (src == null) { return target; } for (const [key, value] of Object.entries(src)) { + if (key === '__proto__' || key === 'constructor') { + continue; + } + if (Array.isArray(value)) { if (target[key] && !Array.isArray(target[key])) { throw new Error(`Trying to merge array [${value}] into a non-array '${target[key]}'`); diff --git a/packages/aws-cdk-lib/aws-ec2/test/cfn-init.test.ts b/packages/aws-cdk-lib/aws-ec2/test/cfn-init.test.ts index a5658931a2eb5..bf6823a598988 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/cfn-init.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/cfn-init.test.ts @@ -660,7 +660,7 @@ function dontExpectLine(lines: string[], re: RegExp) { } function cmdArg(command: string, argument: string) { - return new RegExp(`${escapeRegex(command)}(\.exe)? .*${escapeRegex(argument)}`); + return new RegExp(`${escapeRegex(command)}(\\.exe)? .*${escapeRegex(argument)}`); } function escapeRegex(s: string) { diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/test/ec2/scheduled-ecs-task.test.ts b/packages/aws-cdk-lib/aws-ecs-patterns/test/ec2/scheduled-ecs-task.test.ts index 2d9704e419923..764d99d4216c0 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/test/ec2/scheduled-ecs-task.test.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/test/ec2/scheduled-ecs-task.test.ts @@ -364,7 +364,7 @@ test('Scheduled Ec2 Task shows warning when minute is not defined in cron', () = }); // THEN - Annotations.fromStack(stack).hasWarning('/Default', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-events:scheduleDefaultRunsEveryMinute]"); + Annotations.fromStack(stack).hasWarning('/Default', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-events:scheduleWillRunEveryMinute]"); }); test('Scheduled Ec2 Task shows no warning when minute is * in cron', () => { diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts index 8e425b9230542..8b318fd8b1167 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts @@ -451,7 +451,7 @@ test('Scheduled Fargate Task shows warning when minute is not defined in cron', }); // THEN - Annotations.fromStack(stack).hasWarning('/Default', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-events:scheduleDefaultRunsEveryMinute]"); + Annotations.fromStack(stack).hasWarning('/Default', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-events:scheduleWillRunEveryMinute]"); }); test('Scheduled Fargate Task shows no warning when minute is * in cron', () => { diff --git a/packages/aws-cdk-lib/aws-ecs/lib/images/repository.ts b/packages/aws-cdk-lib/aws-ecs/lib/images/repository.ts index 2a371804177b6..c73658177c4fa 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/images/repository.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/images/repository.ts @@ -8,7 +8,7 @@ import { ContainerImage, ContainerImageConfig } from '../container-image'; * Regex pattern to check if it is an ECR image URL. * */ -const ECR_IMAGE_REGEX = /(^[a-zA-Z0-9][a-zA-Z0-9-_]*).dkr.ecr.([a-zA-Z0-9][a-zA-Z0-9-_]*).amazonaws.com(.cn)?\/.*/; +const ECR_IMAGE_REGEX = /(^[a-zA-Z0-9][a-zA-Z0-9-_]*)\.dkr\.ecr\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.amazonaws.com(\.cn)?\/.*/; /** * The properties for an image hosted in a public or private repository. diff --git a/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts b/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts index d85edf4e940b3..aec9f09bff889 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts @@ -2493,7 +2493,7 @@ describe('fargate service', () => { }); // THEN - Annotations.fromStack(stack).hasWarning('/Default/Service/TaskCount/Target', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-applicationautoscaling:scheduleDefaultRunsEveryMinute]"); + Annotations.fromStack(stack).hasWarning('/Default/Service/TaskCount/Target', "cron: If you don't pass 'minute', by default the event runs every minute. Pass 'minute: '*'' if that's what you intend, or 'minute: 0' to run once per hour instead. [ack: @aws-cdk/aws-applicationautoscaling:defaultRunEveryMinute]"); }); test('scheduled scaling shows no warning when minute is * in cron', () => { diff --git a/packages/aws-cdk-lib/aws-eks/lib/kubectl-handler/helm/__init__.py b/packages/aws-cdk-lib/aws-eks/lib/kubectl-handler/helm/__init__.py index ce5fe63925637..3a5656f46db91 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/kubectl-handler/helm/__init__.py +++ b/packages/aws-cdk-lib/aws-eks/lib/kubectl-handler/helm/__init__.py @@ -100,8 +100,8 @@ def helm_handler(event, context): def get_oci_cmd(repository, version): # Generates OCI command based on pattern. Public ECR vs Private ECR are treated differently. - private_ecr_pattern = 'oci://(?P\d+.dkr.ecr.(?P[a-z0-9\-]+).amazonaws.com)*' - public_ecr_pattern = 'oci://(?Ppublic.ecr.aws)*' + private_ecr_pattern = 'oci://(?P\d+\.dkr\.ecr\.(?P[a-z0-9\-]+)\.amazonaws\.com)*' + public_ecr_pattern = 'oci://(?Ppublic\.ecr\.aws)*' private_registry = re.match(private_ecr_pattern, repository).groupdict() public_registry = re.match(public_ecr_pattern, repository).groupdict() @@ -115,7 +115,7 @@ def get_oci_cmd(repository, version): elif public_registry['registry'] is not None: logger.info("Found AWS public repository, will use default region as deployment") region = os.environ.get('AWS_REGION', 'us-east-1') - + if is_ecr_public_available(region): cmnd = [ f"aws ecr-public get-login-password --region us-east-1 | " \ @@ -124,7 +124,7 @@ def get_oci_cmd(repository, version): else: # `aws ecr-public get-login-password` and `helm registry login` not required as ecr public is not available in current region # see https://helm.sh/docs/helm/helm_registry_login/ - cmnd = [f"helm pull {repository} --version {version} --untar"] + cmnd = [f"helm pull {repository} --version {version} --untar"] else: logger.error("OCI repository format not recognized, falling back to helm pull") cmnd = [f"helm pull {repository} --version {version} --untar"] @@ -144,7 +144,7 @@ def get_chart_from_oci(tmpdir, repository = None, version = None): output = subprocess.check_output(cmnd, stderr=subprocess.STDOUT, cwd=tmpdir, shell=True) logger.info(output) - # effectively returns "$tmpDir/$lastPartOfOCIUrl", because this is how helm pull saves OCI artifact. + # effectively returns "$tmpDir/$lastPartOfOCIUrl", because this is how helm pull saves OCI artifact. # Eg. if we have oci://9999999999.dkr.ecr.us-east-1.amazonaws.com/foo/bar/pet-service repository, helm saves artifact under $tmpDir/pet-service return os.path.join(tmpdir, repository.rpartition('/')[-1]) except subprocess.CalledProcessError as exc: diff --git a/packages/aws-cdk-lib/aws-events-targets/lib/log-group.ts b/packages/aws-cdk-lib/aws-events-targets/lib/log-group.ts index 4e8850fdd4fe8..42ad45dae5204 100644 --- a/packages/aws-cdk-lib/aws-events-targets/lib/log-group.ts +++ b/packages/aws-cdk-lib/aws-events-targets/lib/log-group.ts @@ -146,7 +146,7 @@ export class CloudWatchLogGroup implements events.IRuleTarget { if (typeof(resolvedTemplate) === 'string') { // need to add the quotes back to the string so that we can parse the json // '{"timestamp":