CloudProviderSnapshotBackupPolicy
mongodbatlas..CloudProviderSnapshotBackupPolicy provides a resource that enables you to view and modify the snapshot schedule and retention settings for an Atlas cluster with Cloud Provider Snapshots enabled.
NOTE: Groups and projects are synonymous terms. You may find
groupIdin the official documentation.
Example Usage
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var myCluster = new Mongodbatlas.Cluster("myCluster", new Mongodbatlas.ClusterArgs
{
ProjectId = "<PROJECT-ID>",
DiskSizeGb = 5,
ProviderName = "AWS",
ProviderRegionName = "EU_CENTRAL_1",
ProviderInstanceSizeName = "M10",
ProviderBackupEnabled = true,
ProviderDiskIops = 100,
ProviderEncryptEbsVolume = false,
});
var test = new Mongodbatlas.CloudProviderSnapshotBackupPolicy("test", new Mongodbatlas.CloudProviderSnapshotBackupPolicyArgs
{
ProjectId = myCluster.ProjectId,
ClusterName = myCluster.Name,
ReferenceHourOfDay = 3,
ReferenceMinuteOfHour = 45,
RestoreWindowDays = 4,
Policies =
{
new Mongodbatlas.Inputs.CloudProviderSnapshotBackupPolicyPolicyArgs
{
Id = myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.Id),
Policy_item =
{
{
{ "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[0]?.Id) },
{ "frequencyInterval", 1 },
{ "frequencyType", "hourly" },
{ "retentionUnit", "days" },
{ "retentionValue", 1 },
},
{
{ "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[1]?.Id) },
{ "frequencyInterval", 1 },
{ "frequencyType", "daily" },
{ "retentionUnit", "days" },
{ "retentionValue", 2 },
},
{
{ "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[2]?.Id) },
{ "frequencyInterval", 4 },
{ "frequencyType", "weekly" },
{ "retentionUnit", "weeks" },
{ "retentionValue", 3 },
},
{
{ "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[3]?.Id) },
{ "frequencyInterval", 5 },
{ "frequencyType", "monthly" },
{ "retentionUnit", "months" },
{ "retentionValue", 4 },
},
},
},
},
});
}
}
Coming soon!
import pulumi
import pulumi_mongodbatlas as mongodbatlas
my_cluster = mongodbatlas.Cluster("myCluster",
project_id="<PROJECT-ID>",
disk_size_gb=5,
provider_name="AWS",
provider_region_name="EU_CENTRAL_1",
provider_instance_size_name="M10",
provider_backup_enabled=True,
provider_disk_iops=100,
provider_encrypt_ebs_volume=False)
test = mongodbatlas.CloudProviderSnapshotBackupPolicy("test",
project_id=my_cluster.project_id,
cluster_name=my_cluster.name,
reference_hour_of_day=3,
reference_minute_of_hour=45,
restore_window_days=4,
policies=[{
"id": my_cluster.snapshot_backup_policies[0]["policies"][0]["id"],
"policy_item": [
{
"id": my_cluster.snapshot_backup_policies[0]["policies"][0]["policyItems"][0]["id"],
"frequencyInterval": 1,
"frequencyType": "hourly",
"retentionUnit": "days",
"retentionValue": 1,
},
{
"id": my_cluster.snapshot_backup_policies[0]["policies"][0]["policyItems"][1]["id"],
"frequencyInterval": 1,
"frequencyType": "daily",
"retentionUnit": "days",
"retentionValue": 2,
},
{
"id": my_cluster.snapshot_backup_policies[0]["policies"][0]["policyItems"][2]["id"],
"frequencyInterval": 4,
"frequencyType": "weekly",
"retentionUnit": "weeks",
"retentionValue": 3,
},
{
"id": my_cluster.snapshot_backup_policies[0]["policies"][0]["policyItems"][3]["id"],
"frequencyInterval": 5,
"frequencyType": "monthly",
"retentionUnit": "months",
"retentionValue": 4,
},
],
}])import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const myCluster = new mongodbatlas.Cluster("myCluster", {
projectId: "<PROJECT-ID>",
diskSizeGb: 5,
providerName: "AWS",
providerRegionName: "EU_CENTRAL_1",
providerInstanceSizeName: "M10",
providerBackupEnabled: true,
providerDiskIops: 100,
providerEncryptEbsVolume: false,
});
const test = new mongodbatlas.CloudProviderSnapshotBackupPolicy("test", {
projectId: myCluster.projectId,
clusterName: myCluster.name,
referenceHourOfDay: 3,
referenceMinuteOfHour: 45,
restoreWindowDays: 4,
policies: [{
id: myCluster.snapshotBackupPolicies.apply(snapshotBackupPolicies => snapshotBackupPolicies[0].policies?[0]?.id),
policy_item: [
{
id: myCluster.snapshotBackupPolicies.apply(snapshotBackupPolicies => snapshotBackupPolicies[0].policies?[0]?.policyItems?[0]?.id),
frequencyInterval: 1,
frequencyType: "hourly",
retentionUnit: "days",
retentionValue: 1,
},
{
id: myCluster.snapshotBackupPolicies.apply(snapshotBackupPolicies => snapshotBackupPolicies[0].policies?[0]?.policyItems?[1]?.id),
frequencyInterval: 1,
frequencyType: "daily",
retentionUnit: "days",
retentionValue: 2,
},
{
id: myCluster.snapshotBackupPolicies.apply(snapshotBackupPolicies => snapshotBackupPolicies[0].policies?[0]?.policyItems?[2]?.id),
frequencyInterval: 4,
frequencyType: "weekly",
retentionUnit: "weeks",
retentionValue: 3,
},
{
id: myCluster.snapshotBackupPolicies.apply(snapshotBackupPolicies => snapshotBackupPolicies[0].policies?[0]?.policyItems?[3]?.id),
frequencyInterval: 5,
frequencyType: "monthly",
retentionUnit: "months",
retentionValue: 4,
},
],
}],
});Create a CloudProviderSnapshotBackupPolicy Resource
new CloudProviderSnapshotBackupPolicy(name: string, args: CloudProviderSnapshotBackupPolicyArgs, opts?: CustomResourceOptions);def CloudProviderSnapshotBackupPolicy(resource_name, opts=None, cluster_name=None, policies=None, project_id=None, reference_hour_of_day=None, reference_minute_of_hour=None, restore_window_days=None, update_snapshots=None, __props__=None);func NewCloudProviderSnapshotBackupPolicy(ctx *Context, name string, args CloudProviderSnapshotBackupPolicyArgs, opts ...ResourceOption) (*CloudProviderSnapshotBackupPolicy, error)public CloudProviderSnapshotBackupPolicy(string name, CloudProviderSnapshotBackupPolicyArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args CloudProviderSnapshotBackupPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CloudProviderSnapshotBackupPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudProviderSnapshotBackupPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
CloudProviderSnapshotBackupPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The CloudProviderSnapshotBackupPolicy resource accepts the following input properties:
- Cluster
Name string The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- Policies
List<Cloud
Provider Snapshot Backup Policy Policy Args> Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- Project
Id string The unique identifier of the project for the Atlas cluster.
- Reference
Hour intOf Day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- Reference
Minute intOf Hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- Restore
Window intDays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- Update
Snapshots bool Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
- Cluster
Name string The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- Policies
[]Cloud
Provider Snapshot Backup Policy Policy Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- Project
Id string The unique identifier of the project for the Atlas cluster.
- Reference
Hour intOf Day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- Reference
Minute intOf Hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- Restore
Window intDays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- Update
Snapshots bool Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
- cluster
Name string The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- policies
Cloud
Provider Snapshot Backup Policy Policy[] Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- project
Id string The unique identifier of the project for the Atlas cluster.
- reference
Hour numberOf Day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- reference
Minute numberOf Hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- restore
Window numberDays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- update
Snapshots boolean Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
- cluster_
name str The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- policies
List[Cloud
Provider Snapshot Backup Policy Policy] Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- project_
id str The unique identifier of the project for the Atlas cluster.
- reference_
hour_ floatof_ day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- reference_
minute_ floatof_ hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- restore_
window_ floatdays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- update_
snapshots bool Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
Outputs
All input properties are implicitly available as output properties. Additionally, the CloudProviderSnapshotBackupPolicy resource produces the following output properties:
- cluster_
id str Unique identifier of the Atlas cluster.
- id str
- The provider-assigned unique ID for this managed resource.
- next_
snapshot str Timestamp in the number of seconds that have elapsed since the UNIX epoch when Atlas takes the next snapshot.
Look up an Existing CloudProviderSnapshotBackupPolicy Resource
Get an existing CloudProviderSnapshotBackupPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CloudProviderSnapshotBackupPolicyState, opts?: CustomResourceOptions): CloudProviderSnapshotBackupPolicystatic get(resource_name, id, opts=None, cluster_id=None, cluster_name=None, next_snapshot=None, policies=None, project_id=None, reference_hour_of_day=None, reference_minute_of_hour=None, restore_window_days=None, update_snapshots=None, __props__=None);func GetCloudProviderSnapshotBackupPolicy(ctx *Context, name string, id IDInput, state *CloudProviderSnapshotBackupPolicyState, opts ...ResourceOption) (*CloudProviderSnapshotBackupPolicy, error)public static CloudProviderSnapshotBackupPolicy Get(string name, Input<string> id, CloudProviderSnapshotBackupPolicyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Cluster
Id string Unique identifier of the Atlas cluster.
- Cluster
Name string The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- Next
Snapshot string Timestamp in the number of seconds that have elapsed since the UNIX epoch when Atlas takes the next snapshot.
- Policies
List<Cloud
Provider Snapshot Backup Policy Policy Args> Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- Project
Id string The unique identifier of the project for the Atlas cluster.
- Reference
Hour intOf Day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- Reference
Minute intOf Hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- Restore
Window intDays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- Update
Snapshots bool Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
- Cluster
Id string Unique identifier of the Atlas cluster.
- Cluster
Name string The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- Next
Snapshot string Timestamp in the number of seconds that have elapsed since the UNIX epoch when Atlas takes the next snapshot.
- Policies
[]Cloud
Provider Snapshot Backup Policy Policy Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- Project
Id string The unique identifier of the project for the Atlas cluster.
- Reference
Hour intOf Day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- Reference
Minute intOf Hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- Restore
Window intDays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- Update
Snapshots bool Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
- cluster
Id string Unique identifier of the Atlas cluster.
- cluster
Name string The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- next
Snapshot string Timestamp in the number of seconds that have elapsed since the UNIX epoch when Atlas takes the next snapshot.
- policies
Cloud
Provider Snapshot Backup Policy Policy[] Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- project
Id string The unique identifier of the project for the Atlas cluster.
- reference
Hour numberOf Day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- reference
Minute numberOf Hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- restore
Window numberDays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- update
Snapshots boolean Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
- cluster_
id str Unique identifier of the Atlas cluster.
- cluster_
name str The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
- next_
snapshot str Timestamp in the number of seconds that have elapsed since the UNIX epoch when Atlas takes the next snapshot.
- policies
List[Cloud
Provider Snapshot Backup Policy Policy] Contains a document for each backup policy item in the desired updated backup policy. *
policies.#.id- (Required) Unique identifier of the backup policy that you want to update. policies.#.id is a value obtained via the mongodbatlas..Cluster resource. provider_backup_enabled of the mongodbatlas..Cluster resource must be set to true. See the example above for how to refer to the mongodbatlas..Cluster resource for policies.#.id- project_
id str The unique identifier of the project for the Atlas cluster.
- reference_
hour_ floatof_ day UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
- reference_
minute_ floatof_ hour UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
- restore_
window_ floatdays Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
- update_
snapshots bool Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
Supporting Types
CloudProviderSnapshotBackupPolicyPolicy
CloudProviderSnapshotBackupPolicyPolicyPolicyItem
Package Details
- Repository
- https://github.com/pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.