Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

BackupPolicy

Provides an Elastic File System (EFS) Backup Policy resource. Backup policies turn automatic backups on or off for an existing file system.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var fs = new Aws.Efs.FileSystem("fs", new Aws.Efs.FileSystemArgs
        {
        });
        var policy = new Aws.Efs.BackupPolicy("policy", new Aws.Efs.BackupPolicyArgs
        {
            FileSystemId = fs.Id,
            BackupPolicy = new Aws.Efs.Inputs.BackupPolicyBackupPolicyArgs
            {
                Status = "ENABLED",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/efs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fs, err := efs.NewFileSystem(ctx, "fs", nil)
		if err != nil {
			return err
		}
		_, err = efs.NewBackupPolicy(ctx, "policy", &efs.BackupPolicyArgs{
			FileSystemId: fs.ID(),
			BackupPolicy: &efs.BackupPolicyBackupPolicyArgs{
				Status: pulumi.String("ENABLED"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

fs = aws.efs.FileSystem("fs")
policy = aws.efs.BackupPolicy("policy",
    file_system_id=fs.id,
    backup_policy=aws.efs.BackupPolicyBackupPolicyArgs(
        status="ENABLED",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const fs = new aws.efs.FileSystem("fs", {});
const policy = new aws.efs.BackupPolicy("policy", {
    fileSystemId: fs.id,
    backupPolicy: {
        status: "ENABLED",
    },
});

Create a BackupPolicy Resource

new BackupPolicy(name: string, args: BackupPolicyArgs, opts?: CustomResourceOptions);
@overload
def BackupPolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 backup_policy: Optional[BackupPolicyBackupPolicyArgs] = None,
                 file_system_id: Optional[str] = None)
@overload
def BackupPolicy(resource_name: str,
                 args: BackupPolicyArgs,
                 opts: Optional[ResourceOptions] = None)
func NewBackupPolicy(ctx *Context, name string, args BackupPolicyArgs, opts ...ResourceOption) (*BackupPolicy, error)
public BackupPolicy(string name, BackupPolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args BackupPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args BackupPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BackupPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BackupPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

BackupPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The BackupPolicy resource accepts the following input properties:

BackupPolicyDetails BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
FileSystemId string
The ID of the EFS file system.
BackupPolicy BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
FileSystemId string
The ID of the EFS file system.
backupPolicy BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
fileSystemId string
The ID of the EFS file system.
backup_policy BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
file_system_id str
The ID of the EFS file system.

Outputs

All input properties are implicitly available as output properties. Additionally, the BackupPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing BackupPolicy Resource

Get an existing BackupPolicy 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?: BackupPolicyState, opts?: CustomResourceOptions): BackupPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backup_policy: Optional[BackupPolicyBackupPolicyArgs] = None,
        file_system_id: Optional[str] = None) -> BackupPolicy
func GetBackupPolicy(ctx *Context, name string, id IDInput, state *BackupPolicyState, opts ...ResourceOption) (*BackupPolicy, error)
public static BackupPolicy Get(string name, Input<string> id, BackupPolicyState? 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:

BackupPolicyDetails BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
FileSystemId string
The ID of the EFS file system.
BackupPolicy BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
FileSystemId string
The ID of the EFS file system.
backupPolicy BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
fileSystemId string
The ID of the EFS file system.
backup_policy BackupPolicyBackupPolicyArgs
A backup_policy object (documented below).
file_system_id str
The ID of the EFS file system.

Supporting Types

BackupPolicyBackupPolicy

Status string
A status of the backup policy. Valid values: ENABLED, DISABLED.
Status string
A status of the backup policy. Valid values: ENABLED, DISABLED.
status string
A status of the backup policy. Valid values: ENABLED, DISABLED.
status str
A status of the backup policy. Valid values: ENABLED, DISABLED.

Import

The EFS backup policies can be imported using the id, e.g.

 $ pulumi import aws:efs/backupPolicy:BackupPolicy example fs-6fa144c6

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.