Class 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 },
},
},
},
},
});
}
}
Inherited Members
Namespace: Pulumi.Mongodbatlas
Assembly: Pulumi.Mongodbatlas.dll
Syntax
public class CloudProviderSnapshotBackupPolicy : CustomResource
Constructors
View SourceCloudProviderSnapshotBackupPolicy(String, CloudProviderSnapshotBackupPolicyArgs, CustomResourceOptions)
Create a CloudProviderSnapshotBackupPolicy resource with the given unique name, arguments, and options.
Declaration
public CloudProviderSnapshotBackupPolicy(string name, CloudProviderSnapshotBackupPolicyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| CloudProviderSnapshotBackupPolicyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceClusterId
Unique identifier of the Atlas cluster.
Declaration
public Output<string> ClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ClusterName
The name of the Atlas cluster that contains the snapshot backup policy you want to retrieve.
Declaration
public Output<string> ClusterName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NextSnapshot
Timestamp in the number of seconds that have elapsed since the UNIX epoch when Atlas takes the next snapshot.
Declaration
public Output<string> NextSnapshot { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Policies
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
Declaration
public Output<ImmutableArray<CloudProviderSnapshotBackupPolicyPolicy>> Policies { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<CloudProviderSnapshotBackupPolicyPolicy>> |
ProjectId
The unique identifier of the project for the Atlas cluster.
Declaration
public Output<string> ProjectId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ReferenceHourOfDay
UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
Declaration
public Output<int> ReferenceHourOfDay { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
ReferenceMinuteOfHour
UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
Declaration
public Output<int> ReferenceMinuteOfHour { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
RestoreWindowDays
Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
Declaration
public Output<int> RestoreWindowDays { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
UpdateSnapshots
Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
Declaration
public Output<bool> UpdateSnapshots { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Methods
View SourceGet(String, Input<String>, CloudProviderSnapshotBackupPolicyState, CustomResourceOptions)
Get an existing CloudProviderSnapshotBackupPolicy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static CloudProviderSnapshotBackupPolicy Get(string name, Input<string> id, CloudProviderSnapshotBackupPolicyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| CloudProviderSnapshotBackupPolicyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| CloudProviderSnapshotBackupPolicy |