feat: Backup Compliance Policy CloudFormation Resource#1535
Merged
rakhul-mongo merged 5 commits intomasterfrom Jan 29, 2026
Merged
feat: Backup Compliance Policy CloudFormation Resource#1535rakhul-mongo merged 5 commits intomasterfrom
rakhul-mongo merged 5 commits intomasterfrom
Conversation
daa7387 to
90bbac7
Compare
90bbac7 to
2207423
Compare
oarbusi
reviewed
Jan 28, 2026
| } | ||
|
|
||
| if policy.ProjectId != nil { | ||
| currentModel.ProjectId = policy.ProjectId |
Collaborator
There was a problem hiding this comment.
why not currentModel.ProjectId = policy.GetProjectId()?
Contributor
There was a problem hiding this comment.
Valid point, updated as per suggested.
oarbusi
reviewed
Jan 28, 2026
Comment on lines
+214
to
+232
| frequencyInterval := 0 | ||
| if item.FrequencyInterval != nil { | ||
| frequencyInterval = *item.FrequencyInterval | ||
| } | ||
| retentionValue := 0 | ||
| if item.RetentionValue != nil { | ||
| retentionValue = *item.RetentionValue | ||
| } | ||
| retentionUnit := "" | ||
| if item.RetentionUnit != nil { | ||
| retentionUnit = *item.RetentionUnit | ||
| } | ||
| return &admin.BackupComplianceOnDemandPolicyItem{ | ||
| Id: item.Id, | ||
| FrequencyInterval: frequencyInterval, | ||
| FrequencyType: "ondemand", | ||
| RetentionUnit: retentionUnit, | ||
| RetentionValue: retentionValue, | ||
| } |
Collaborator
There was a problem hiding this comment.
nit, but this way you don't have to declare the variables with the zero values
Suggested change
| frequencyInterval := 0 | |
| if item.FrequencyInterval != nil { | |
| frequencyInterval = *item.FrequencyInterval | |
| } | |
| retentionValue := 0 | |
| if item.RetentionValue != nil { | |
| retentionValue = *item.RetentionValue | |
| } | |
| retentionUnit := "" | |
| if item.RetentionUnit != nil { | |
| retentionUnit = *item.RetentionUnit | |
| } | |
| return &admin.BackupComplianceOnDemandPolicyItem{ | |
| Id: item.Id, | |
| FrequencyInterval: frequencyInterval, | |
| FrequencyType: "ondemand", | |
| RetentionUnit: retentionUnit, | |
| RetentionValue: retentionValue, | |
| } | |
| onDemandPolicy := &admin.BackupComplianceOnDemandPolicyItem{ | |
| Id: item.Id, | |
| FrequencyType: "ondemand", | |
| } | |
| if item.FrequencyInterval != nil { | |
| onDemandPolicy.FrequencyInterval = *item.FrequencyInterval | |
| } | |
| if item.RetentionValue != nil { | |
| onDemandPolicy.RetentionValue = *item.RetentionValue | |
| } | |
| if item.RetentionUnit != nil { | |
| onDemandPolicy.RetentionUnit = *item.RetentionUnit | |
| } | |
| return onDemandPolicy |
Contributor
There was a problem hiding this comment.
This is better, thanks
oarbusi
reviewed
Jan 28, 2026
| } | ||
| } | ||
|
|
||
| func ExpandScheduledPolicyItem(item *ScheduledPolicyItem, frequencyType string) admin.BackupComplianceScheduledPolicyItem { |
Collaborator
There was a problem hiding this comment.
same suggestion from ExpandOnDemandPolicyItem could be applied here
oarbusi
approved these changes
Jan 28, 2026
Collaborator
oarbusi
left a comment
There was a problem hiding this comment.
LGTM, just some suggestions
e68facc to
518aa9e
Compare
518aa9e to
3d94e0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Added new resource Backup Compliance Policy:
Resource Schema:
Required Properties:
ProjectId: Unique identifier of the projectAuthorizedEmail: Email address of authorized userAuthorizedUserFirstName: First name of authorized userAuthorizedUserLastName: Last name of authorized userOptional Properties:
CopyProtectionEnabled: Enable additional copy protection (default: false)EncryptionAtRestEnabled: Require Encryption at Rest using CKM (default: false)PitEnabled: Enable Continuous Cloud Backup (default: false)RestoreWindowDays: Number of days for restore windowOnDemandPolicyItem: On-demand backup policy configurationPolicyItemHourly: Hourly backup policy itemPolicyItemDaily: Daily backup policy itemPolicyItemWeekly: Array of weekly backup policy itemsPolicyItemMonthly: Array of monthly backup policy itemsPolicyItemYearly: Array of yearly backup policy itemsCreate-Only Properties:
ProjectId: Cannot be changed after creationConfiguration Examples:
Basic Backup Compliance Policy:
cfn-testing
Published to AWS private registry
Stack Testing
Atlas
before
create
update
delete
Jira ticket: CLOUDP-369800
Please include a summary of the fix/feature/change, including any relevant motivation and context.
Link to any related issue(s):
Type of change:
expected)
Manual QA performed:
Required Checklist:
make fmtand formatted my codeworks in Atlas.