Skip to content

Commit c59119e

Browse files
committed
Cognito user backups
1 parent 40e03c6 commit c59119e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1725
-326
lines changed

backend/bin/compile_requirements.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ pip-compile --no-emit-index-url --upgrade --no-strip-extras multi-account/log-ag
66
pip-compile --no-emit-index-url --upgrade --no-strip-extras multi-account/log-aggregation/requirements.in
77
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/requirements-dev.in
88
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/requirements.in
9+
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/lambdas/python/cognito-backup/requirements-dev.in
10+
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/lambdas/python/cognito-backup/requirements.in
911
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/lambdas/python/compact-configuration/requirements-dev.in
1012
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/lambdas/python/compact-configuration/requirements.in
1113
pip-compile --no-emit-index-url --upgrade --no-strip-extras compact-connect/lambdas/python/common/requirements-dev.in

backend/bin/run_python_tests.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
# Define the test directories to include
2424
TEST_DIRS = (
2525
'compact-connect/lambdas/python/common',
26+
'compact-connect/lambdas/python/cognito-backup',
2627
'compact-connect/lambdas/python/compact-configuration',
27-
'compact-connect/lambdas/python/provider-data-v1',
28-
'compact-connect/lambdas/python/purchases',
29-
'compact-connect/lambdas/python/staff-users',
30-
'compact-connect/lambdas/python/staff-user-pre-token',
3128
'compact-connect/lambdas/python/custom-resources',
3229
'compact-connect/lambdas/python/data-events',
3330
'compact-connect/lambdas/python/migration',
31+
'compact-connect/lambdas/python/provider-data-v1',
32+
'compact-connect/lambdas/python/purchases',
33+
'compact-connect/lambdas/python/staff-user-pre-token',
34+
'compact-connect/lambdas/python/staff-users',
3435
'compact-connect', # CDK tests
3536
'multi-account/control-tower',
3637
'multi-account/log-aggregation',

backend/bin/sync_deps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pip-sync \
1010
multi-account/log-aggregation/requirements.txt \
1111
compact-connect/requirements-dev.txt \
1212
compact-connect/requirements.txt \
13+
compact-connect/lambdas/python/cognito-backup/requirements-dev.txt \
14+
compact-connect/lambdas/python/cognito-backup/requirements.txt \
1315
compact-connect/lambdas/python/compact-configuration/requirements-dev.txt \
1416
compact-connect/lambdas/python/compact-configuration/requirements.txt \
1517
compact-connect/lambdas/python/common/requirements-dev.txt \

backend/compact-connect/cdk.context.beta-example.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,25 @@
2929
},
3030
"backup_policies": {
3131
"general_data": {
32-
"schedule": "cron(0 5 ? * 1 *)",
33-
"delete_after_days": 365,
34-
"cold_storage_after_days": 30
35-
},
36-
"ssn_data": {
37-
"schedule": "cron(0 5 ? * 1 *)",
38-
"delete_after_days": 365,
32+
"schedule": {
33+
"week_day": "5",
34+
"year": "*",
35+
"month": "*",
36+
"hour": "5",
37+
"minute": "0"
38+
},
39+
"delete_after_days": 180,
3940
"cold_storage_after_days": 30
4041
},
4142
"frequent_updates": {
42-
"schedule": "cron(0 6 * * ? *)",
43-
"delete_after_days": 365,
44-
"cold_storage_after_days": 30
45-
},
46-
"document_storage": {
47-
"schedule": "cron(0 5 * * ? *)",
48-
"delete_after_days": 365,
43+
"schedule": {
44+
"week_day": "5",
45+
"year": "*",
46+
"month": "*",
47+
"hour": "5",
48+
"minute": "0"
49+
},
50+
"delete_after_days": 180,
4951
"cold_storage_after_days": 30
5052
}
5153
}

backend/compact-connect/cdk.context.prod-example.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,25 @@
2929
},
3030
"backup_policies": {
3131
"general_data": {
32-
"schedule": "cron(0 5 * * ? *)",
33-
"delete_after_days": 365,
34-
"cold_storage_after_days": 30
35-
},
36-
"ssn_data": {
37-
"schedule": "cron(0 5 * * ? *)",
38-
"delete_after_days": 365,
32+
"schedule": {
33+
"year": "*",
34+
"month": "*",
35+
"day": "*",
36+
"hour": "5",
37+
"minute": "0"
38+
},
39+
"delete_after_days": 730,
3940
"cold_storage_after_days": 30
4041
},
4142
"frequent_updates": {
42-
"schedule": "cron(0 * ? * * *)",
43-
"delete_after_days": 365,
44-
"cold_storage_after_days": 30
45-
},
46-
"document_storage": {
47-
"schedule": "cron(0 5 * * ? *)",
48-
"delete_after_days": 365,
43+
"schedule": {
44+
"year": "*",
45+
"month": "*",
46+
"day": "*",
47+
"hour": "*",
48+
"minute": "0"
49+
},
50+
"delete_after_days": 730,
4951
"cold_storage_after_days": 30
5052
}
5153
}
@@ -54,8 +56,8 @@
5456
"backup_config": {
5557
"backup_account_id": "111122223333",
5658
"backup_region": "us-west-2",
57-
"general_vault_name": "CompactConnectBackupVault",
58-
"ssn_vault_name": "CompactConnectBackupVault-SSN"
59+
"general_vault_name": "CompactConnect-prod-BackupVault",
60+
"ssn_vault_name": "CompactConnect-prod-SSNBackupVault"
5961
}
6062
}
6163
}

backend/compact-connect/cdk.context.sandbox-example.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,25 @@
2727
},
2828
"backup_policies": {
2929
"general_data": {
30-
"schedule": "cron(0 5 ? * 1 *)",
31-
"delete_after_days": 365,
32-
"cold_storage_after_days": 30
33-
},
34-
"ssn_data": {
35-
"schedule": "cron(0 5 ? * 1 *)",
36-
"delete_after_days": 365,
30+
"schedule": {
31+
"week_day": "5",
32+
"year": "*",
33+
"month": "*",
34+
"hour": "5",
35+
"minute": "0"
36+
},
37+
"delete_after_days": 180,
3738
"cold_storage_after_days": 30
3839
},
3940
"frequent_updates": {
40-
"schedule": "cron(0 6 * * ? *)",
41-
"delete_after_days": 365,
42-
"cold_storage_after_days": 30
43-
},
44-
"document_storage": {
45-
"schedule": "cron(0 5 * * ? *)",
46-
"delete_after_days": 365,
41+
"schedule": {
42+
"week_day": "5",
43+
"year": "*",
44+
"month": "*",
45+
"hour": "5",
46+
"minute": "0"
47+
},
48+
"delete_after_days": 180,
4749
"cold_storage_after_days": 30
4850
}
4951
}

backend/compact-connect/cdk.context.test-example.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,25 @@
3030
},
3131
"backup_policies": {
3232
"general_data": {
33-
"schedule": "cron(0 5 ? * 1 *)",
34-
"delete_after_days": 365,
35-
"cold_storage_after_days": 30
36-
},
37-
"ssn_data": {
38-
"schedule": "cron(0 5 ? * 1 *)",
39-
"delete_after_days": 365,
33+
"schedule": {
34+
"week_day": "5",
35+
"year": "*",
36+
"month": "*",
37+
"hour": "5",
38+
"minute": "0"
39+
},
40+
"delete_after_days": 180,
4041
"cold_storage_after_days": 30
4142
},
4243
"frequent_updates": {
43-
"schedule": "cron(0 6 * * ? *)",
44-
"delete_after_days": 365,
45-
"cold_storage_after_days": 30
46-
},
47-
"document_storage": {
48-
"schedule": "cron(0 5 * * ? *)",
49-
"delete_after_days": 365,
44+
"schedule": {
45+
"week_day": "5",
46+
"year": "*",
47+
"month": "*",
48+
"hour": "5",
49+
"minute": "0"
50+
},
51+
"delete_after_days": 180,
5052
"cold_storage_after_days": 30
5153
}
5254
}

backend/compact-connect/common_constructs/backup_plan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(
4646
BackupPlanRule(
4747
rule_name=f'{backup_plan_name_prefix}-Backup',
4848
backup_vault=backup_vault,
49-
schedule_expression=Schedule.expression(backup_policy['schedule']),
49+
schedule_expression=Schedule.cron(**backup_policy['schedule']),
5050
delete_after=Duration.days(backup_policy['delete_after_days']),
5151
move_to_cold_storage_after=Duration.days(backup_policy['cold_storage_after_days']),
5252
copy_actions=[

0 commit comments

Comments
 (0)