The AtlasBackupCompliancePolicy custom resource configures a
Backup Compliance Policy that applies to the
AtlasProject Custom Resource to protect your backup data. When
you create the AtlasBackupCompliancePolicy custom resource, Atlas Kubernetes Operator
tries to create or update a Backup Compliance Policy.
Atlas Kubernetes Operator does one of the following actions using the Atlas Backup Compliance Policy API Resource:
Creates a new Backup Compliance Policy.
Updates an existing Backup Compliance Policy.
Important
See the Prohibited Actions and Considerations. A Backup Compliance Policy applies as the minimum backup policy to all clusters in the project. The Backup Compliance Policy protects all existing snapshots. The Backup Compliance Policy prevents any user, regardless of role, from modifying or deleting existing snapshots prior to their expiration. Changes made to this Backup Compliance Policy apply only to future snapshots. If you enable a Backup Compliance Policy, the Backup Compliance Policy limits your ability to reduce backup storage costs. You can't adjust the retention or delete a backup to reduce the backup storage costs.
Example
The following example shows a BackupCompliancePolicy custom
resource. To learn more, see Configure a Backup Compliance Policy.
apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupCompliancePolicy metadata: name: my-backup-compliance-policy namespace: mongodb-atlas-system spec: authorizedEmail: john.doe@example.com authorizedUserFirstName: John authorizedUserLastName: Doe copyProtectionEnabled: false encryptionAtRestEnabled: false onDemandPolicy: retentionUnit: weeks retentionValue: 3 overwriteBackupPolicies: false pointInTimeEnabled: true restoreWindowDays: 42 scheduledPolicyItems: - frequencyInterval: 2 frequencyType: daily retentionUnit: days retentionValue: 7
Parameters
This section describes some of the key BackupCompliancePolicy custom
resource parameters available. For a full list of parameters available,
see the Atlas Update or Enable the Backup Compliance Policy settings API. Refer to these
descriptions, the available examples, and the API documentation to
customize your specifications.
spec.authorizedEmailType: string
Required
Email address of an authorized security or legal representative.
Important
An invalid or incorrect email address prevents you from modifying or enabling this Backup Compliance Policy until you correct it with MongoDB Support.
spec.authorizedUserFirstNameType: string
Required
First name of an authorized security or legal representative.
spec.authorizedUserLastNameType: string
Required
Last name of an authorized security or legal representative.
spec.copyProtectionEnabledType: boolean
Optional
Flag that indicates whether to keep all snapshots when removing additional snapshot regions. This parameter defaults to
false.Note
You can prevent cluster users from deleting backups copied to other regions even if you change this parameter to
false. To learn more, see Configure Atlas to Automatically Copy Snapshots to Other Regions.
spec.encryptionAtRestEnabledType: boolean
Optional
Flag that indicates whether to require Encryption at Rest using Customer Key Management for all clusters. This parameter defaults to
false.Note
To enable this option, you must Enable Encryption at Rest for all current clusters. You can't enable this option on paused clusters that don't have Encryption at Rest enabled.
spec.onDemandPolicyType: object
Optional
Object that contains the settings for the on-demand snapshot policy item.
spec.onDemandPolicy.frequencyIntervalType: number
Required
Number that indicates the desired frequency of the policy item specified by
spec.onDemandPolicy.frequencyType. A value of1specifies the first instance of the correspondingspec.onDemandPolicy.frequencyType.Example
In a monthly Backup Compliance Policy,
1indicates that the monthly snapshot occurs on the first day of the month.In a weekly Backup Compliance Policy,
1indicates that the weekly snapshot occurs on Monday.
This setting accepts the following frequency values:
Hourly:
1,2,4,6,8, and12.Daily:
1.Weekly:
1through7, where1is Monday and7is Sunday.Monthly:
1through28and40, where1is the first day of the month and40is the last day of the month.
spec.onDemandPolicy.frequencyTypeType: string
Required
String that indicates the frequency associated with the policy item. Accepted values are:
hourly,daily,weekly, ormonthly.Note
You can't specify multiple
hourlyanddailybackup policy onDemandPolicy.
spec.onDemandPolicy.retentionUnitType: string
Required
String that indicates the scope of the policy item. Together with
spec.onDemandPolicy.retentionValue, these settings define the length of time to retain snapshots. Accepted values are:days,weeks, ormonths.
spec.onDemandPolicy.retentionValueType: string
Required
String that indicates the value to associate with
spec.onDemandPolicy.retentionUnit. Together withspec.onDemandPolicy.retentionUnit, these settings define the length of time to retain snapshots.
spec.overwriteBackupPoliciesType: boolean
Required
Flag that indicates whether to upgrade all backup policies in the project regardless of what is specified in the
AtlasBackupPolicyCustom Resource.Important
If you set this parameter to
true, Atlas upgrades all backup policies in the project regardless of what is specified in theAtlasBackupPolicyCustom Resource. Atlas overrides theAtlasBackupPolicyCustom Resource and the status of that custom resource updates toReady: False. You must manually update theAtlasBackupPolicyCustom Resource to align with the Backup Compliance Policy.If you set this parameter to
false, creating the Backup Compliance Policy fails if the existing backup policies do not satisfy the Backup Compliance Policy.
spec.pitEnabledType: boolean
Optional
Flag that indicates whether to require a point in time restore to all clusters. This parameter defaults to
false.
spec.restoreWindowDaysType: number
Conditional
Number of days in the restore window for point in time restore. If you set
spec.pitEnabledtotrue, you must specify this parameter.Important
You can't configure a restore window that is longer than the Hourly Snapshot Retention Time. After you save this Backup Compliance Policy, you can't change this setting without MongoDB support. To change this setting, the security or legal representative specified for the Backup Compliance Policy must request support and complete an extensive verification process.
spec.scheduledPolicyItemsType: object
Optional
Object that contains the settings for the snapshot policy items.
spec.scheduledPolicyItems.frequencyIntervalType: number
Required
Number that indicates the desired frequency of the policy item specified by
spec.scheduledPolicyItems.frequencyType. A value of1specifies the first instance of the correspondingspec.scheduledPolicyItems.frequencyType.Example
In a monthly Backup Compliance Policy,
1indicates that the monthly snapshot occurs on the first day of the month.In a weekly Backup Compliance Policy,
1indicates that the weekly snapshot occurs on Monday.
This setting accepts the following frequency values:
Hourly:
1,2,4,6,8, and12.Daily:
1.Weekly:
1through7, where1is Monday and7is Sunday.Monthly:
1through28and40, where1is the first day of the month and40is the last day of the month.
spec.scheduledPolicyItems.frequencyTypeType: string
Required
String that indicates the frequency associated with the policy item. Accepted values are:
hourly,daily,weekly, ormonthly.Note
You can't specify multiple
hourlyanddailybackup policy scheduledPolicyItems.
spec.scheduledPolicyItems.retentionUnitType: string
Required
String that indicates the scope of the policy item. Together with
spec.scheduledPolicyItems.retentionValue, these settings define the length of time to retain snapshots. Accepted values are:days,weeks, ormonths.
spec.scheduledPolicyItems.retentionValueType: string
Required
String that indicates the value to associate with
spec.scheduledPolicyItems.retentionUnit. Together withspec.scheduledPolicyItems.retentionUnit, these settings define the length of time to retain snapshots.