AtlasBackupCompliancePolicy
Custom Resource
On this page
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.authorizedEmail
Type: 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.authorizedUserFirstName
Type: string
Required
First name of an authorized security or legal representative.
spec.authorizedUserLastName
Type: string
Required
Last name of an authorized security or legal representative.
spec.copyProtectionEnabled
Type: 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.encryptionAtRestEnabled
Type: 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.onDemandPolicy
Type: object
Optional
Object that contains the settings for the on-demand snapshot policy item.
spec.onDemandPolicy.frequencyInterval
Type: number
Required
Number that indicates the desired frequency of the policy item specified by
spec.onDemandPolicy.frequencyType
. A value of1
specifies the first instance of the correspondingspec.onDemandPolicy.frequencyType
.Example
In a monthly Backup Compliance Policy,
1
indicates that the monthly snapshot occurs on the first day of the month.In a weekly Backup Compliance Policy,
1
indicates that the weekly snapshot occurs on Monday.
This setting accepts the following frequency values:
Hourly:
1
,2
,4
,6
,8
, and12
.Daily:
1
.Weekly:
1
through7
, where1
is Monday and7
is Sunday.Monthly:
1
through28
and40
, where1
is the first day of the month and40
is the last day of the month.
spec.onDemandPolicy.frequencyType
Type: 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
hourly
anddaily
backup policy onDemandPolicy.
spec.onDemandPolicy.retentionUnit
Type: 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.retentionValue
Type: 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.overwriteBackupPolicies
Type: boolean
Required
Flag that indicates whether to upgrade all backup policies in the project regardless of what is specified in the
AtlasBackupPolicy
Custom Resource.Important
If you set this parameter to
true
, Atlas upgrades all backup policies in the project regardless of what is specified in theAtlasBackupPolicy
Custom Resource. Atlas overrides theAtlasBackupPolicy
Custom Resource and the status of that custom resource updates toReady: False
. You must manually update theAtlasBackupPolicy
Custom 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.pitEnabled
Type: boolean
Optional
Flag that indicates whether to require a point in time restore to all clusters. This parameter defaults to
false
.
spec.restoreWindowDays
Type: number
Conditional
Number of days in the restore window for point in time restore. If you set
spec.pitEnabled
totrue
, 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.scheduledPolicyItems
Type: object
Optional
Object that contains the settings for the snapshot policy items.
spec.scheduledPolicyItems.frequencyInterval
Type: number
Required
Number that indicates the desired frequency of the policy item specified by
spec.scheduledPolicyItems.frequencyType
. A value of1
specifies the first instance of the correspondingspec.scheduledPolicyItems.frequencyType
.Example
In a monthly Backup Compliance Policy,
1
indicates that the monthly snapshot occurs on the first day of the month.In a weekly Backup Compliance Policy,
1
indicates that the weekly snapshot occurs on Monday.
This setting accepts the following frequency values:
Hourly:
1
,2
,4
,6
,8
, and12
.Daily:
1
.Weekly:
1
through7
, where1
is Monday and7
is Sunday.Monthly:
1
through28
and40
, where1
is the first day of the month and40
is the last day of the month.
spec.scheduledPolicyItems.frequencyType
Type: 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
hourly
anddaily
backup policy scheduledPolicyItems.
spec.scheduledPolicyItems.retentionUnit
Type: 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.retentionValue
Type: 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.