Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Schedule class #27105

Merged
merged 34 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2a37ef5
prelim scheduel in core
kaizencc Sep 7, 2023
1a7848e
fix schedule
kaizencc Sep 11, 2023
c1d2e2e
expose backup.Schedule, create BackupPlanRule.schedule, deprecated Ba…
kaizencc Sep 11, 2023
9597cd8
add timezone to at expression
kaizencc Sep 11, 2023
e72f216
add bind to core.Schedule, rename protected methods as protectedXxx c…
kaizencc Sep 11, 2023
89e2355
move schedule.ts to helpers-internal
kaizencc Sep 11, 2023
8645d07
move schedule back tto main
kaizencc Sep 11, 2023
72ec383
export
kaizencc Sep 11, 2023
f59f475
synthetics
kaizencc Sep 11, 2023
2c04d30
scheduler
kaizencc Sep 11, 2023
404ab4c
touchups
kaizencc Sep 11, 2023
eda29d3
Merge branch 'main' into conroy/schedulecore
kaizencc Sep 11, 2023
97e492e
add annotations and fix some tests
kaizencc Sep 11, 2023
863d720
Merge branch 'main' into conroy/schedulecore
kaizencc Sep 13, 2023
8399112
Update packages/aws-cdk-lib/aws-backup/lib/schedule.ts
kaizencc Sep 13, 2023
20cb339
rename to CoreSchedule
kaizencc Sep 13, 2023
223070e
backup synth check
kaizencc Sep 13, 2023
b1940c7
autoscaling timezone test
kaizencc Sep 13, 2023
380bf5f
finally fixed nuance in autoscaling.Schedule
kaizencc Sep 14, 2023
ab7a05a
Merge branch 'main' into conroy/schedulecore
kaizencc Sep 14, 2023
acd58a2
add documentation
kaizencc Sep 14, 2023
c64a3ca
fix bugs and tests in scheduler
kaizencc Sep 19, 2023
66d1df7
finalize schedule class
kaizencc Sep 19, 2023
70ac3bf
minor test fixes
kaizencc Sep 19, 2023
40f4078
test schedule in core
kaizencc Sep 19, 2023
240a016
Merge branch 'main' into conroy/schedulecore
kaizencc Sep 19, 2023
1e444c8
fix tests
kaizencc Sep 19, 2023
44b535e
lint
kaizencc Sep 19, 2023
b1f3603
Merge branch 'main' into conroy/schedulecore
kaizencc Sep 19, 2023
a530f35
snappies
kaizencc Sep 19, 2023
094c454
Merge branch 'main' into conroy/schedulecore
kaizencc Sep 19, 2023
3697f55
fix cronoptions
kaizencc Sep 19, 2023
77fd854
Update packages/@aws-cdk/aws-scheduler-alpha/test/schedule-expression…
kaizencc Sep 20, 2023
1efab47
Merge branch 'main' into conroy/schedulecore
mergify[bot] Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "32.0.0",
"version": "34.0.0",
"files": {
"0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5": {
"7617f116cb014747232d2ebeb42fb3e22242c4b0987526daf7a033aba236d976": {
"source": {
"path": "cdk-backup.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5.json",
"objectKey": "7617f116cb014747232d2ebeb42fb3e22242c4b0987526daf7a033aba236d976.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@
},
"RuleName": "Daily",
"ScheduleExpression": "cron(0 5 * * ? *)",
"ScheduleExpressionTimezone": "Etc/UTC",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the timezone by default should be etc_utc, so I don't see a problem with adding this diff to the template

"TargetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
@@ -96,6 +97,7 @@
},
"RuleName": "Weekly",
"ScheduleExpression": "cron(0 5 ? * SAT *)",
"ScheduleExpressionTimezone": "Etc/UTC",
"TargetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
@@ -110,6 +112,7 @@
},
"RuleName": "Monthly5Year",
"ScheduleExpression": "cron(0 5 1 * ? *)",
"ScheduleExpressionTimezone": "Etc/UTC",
"TargetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"32.0.0"}
{"version":"34.0.0"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "33.0.0",
"version": "34.0.0",
"testCases": {
"integ.backup": {
"stacks": [
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "33.0.0",
"version": "34.0.0",
"artifacts": {
"cdk-backup.assets": {
"type": "cdk:asset-manifest",
@@ -14,10 +14,11 @@
"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}/0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7617f116cb014747232d2ebeb42fb3e22242c4b0987526daf7a033aba236d976.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Original file line number Diff line number Diff line change
@@ -37,22 +37,22 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_dynamodb.CfnTable",
"version": "0.0.0"
}
},
"ScalingRole": {
"id": "ScalingRole",
"path": "cdk-backup/Table/ScalingRole",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.Resource",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_dynamodb.Table",
"version": "0.0.0"
}
},
"FileSystem": {
@@ -63,8 +63,8 @@
"aws:cdk:cloudformation:props": {}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_efs.CfnFileSystem",
"version": "0.0.0"
}
},
"Vault": {
@@ -84,14 +84,14 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.CfnBackupVault",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.BackupVault",
"version": "0.0.0"
}
},
"SecondaryVault": {
@@ -111,22 +111,22 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.CfnBackupVault",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.BackupVault",
"version": "0.0.0"
}
},
"Env": {
"id": "Env",
"path": "cdk-backup/Env",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.CfnParameter",
"version": "0.0.0"
}
},
"ThirdVault": {
@@ -156,14 +156,14 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.CfnBackupVault",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.BackupVault",
"version": "0.0.0"
}
},
"Plan": {
@@ -185,6 +185,7 @@
},
"ruleName": "Daily",
"scheduleExpression": "cron(0 5 * * ? *)",
"scheduleExpressionTimezone": "Etc/UTC",
"targetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
@@ -198,6 +199,7 @@
},
"ruleName": "Weekly",
"scheduleExpression": "cron(0 5 ? * SAT *)",
"scheduleExpressionTimezone": "Etc/UTC",
"targetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
@@ -212,6 +214,7 @@
},
"ruleName": "Monthly5Year",
"scheduleExpression": "cron(0 5 1 * ? *)",
"scheduleExpressionTimezone": "Etc/UTC",
"targetBackupVault": {
"Fn::GetAtt": [
"Vault23237E5B",
@@ -250,8 +253,8 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.CfnBackupPlan",
"version": "0.0.0"
}
},
"Selection": {
@@ -266,8 +269,8 @@
"id": "ImportRole",
"path": "cdk-backup/Plan/Selection/Role/ImportRole",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.Resource",
"version": "0.0.0"
}
},
"Resource": {
@@ -305,14 +308,14 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_iam.CfnRole",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_iam.Role",
"version": "0.0.0"
}
},
"Resource": {
@@ -394,56 +397,56 @@
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.CfnBackupSelection",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.BackupSelection",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.aws_backup.BackupPlan",
"version": "0.0.0"
}
},
"BootstrapVersion": {
"id": "BootstrapVersion",
"path": "cdk-backup/BootstrapVersion",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.CfnParameter",
"version": "0.0.0"
}
},
"CheckBootstrapVersion": {
"id": "CheckBootstrapVersion",
"path": "cdk-backup/CheckBootstrapVersion",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.CfnRule",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.Stack",
"version": "0.0.0"
}
},
"Tree": {
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"version": "10.2.70"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.69"
"fqn": "aws-cdk-lib.App",
"version": "0.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "20.0.0",
"version": "34.0.0",
"files": {
"619c64c0f19a7d78d759641bfba47f06ebbd7ffb42aae71ec695a6777a534d01": {
"865151155140d0ba599d3522f659db77ada497ea1a763cf11c3fb58d017a3082": {
"source": {
"path": "aws-cdk-dynamodb.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "619c64c0f19a7d78d759641bfba47f06ebbd7ffb42aae71ec695a6777a534d01.json",
"objectKey": "865151155140d0ba599d3522f659db77ada497ea1a763cf11c3fb58d017a3082.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Original file line number Diff line number Diff line change
@@ -3,16 +3,16 @@
"TableCD117FA1": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"KeySchema": [
"AttributeDefinitions": [
{
"AttributeName": "hashKey",
"KeyType": "HASH"
"AttributeType": "S"
}
],
"AttributeDefinitions": [
"KeySchema": [
{
"AttributeName": "hashKey",
"AttributeType": "S"
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
@@ -56,23 +56,25 @@
]
},
"ScalableDimension": "dynamodb:table:ReadCapacityUnits",
"ServiceNamespace": "dynamodb",
"ScheduledActions": [
{
"ScalableTargetAction": {
"MinCapacity": 20
},
"Schedule": "cron(0 8 * * ? *)",
"ScheduledActionName": "ScaleUpInTheMorning"
"ScheduledActionName": "ScaleUpInTheMorning",
"Timezone": "Etc/UTC"
},
{
"ScalableTargetAction": {
"MaxCapacity": 20
},
"Schedule": "cron(0 20 * * ? *)",
"ScheduledActionName": "ScaleDownAtNight"
"ScheduledActionName": "ScaleDownAtNight",
"Timezone": "Etc/UTC"
}
]
],
"ServiceNamespace": "dynamodb"
}
},
"TableReadScalingTargetTracking67DF0596": {
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"20.0.0"}
{"version":"34.0.0"}
Loading