aws logo
AWS Classic v5.34.0, Mar 30 23

aws.efs.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 System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var fs = new Aws.Efs.FileSystem("fs");

    var policy = new Aws.Efs.BackupPolicy("policy", new()
    {
        FileSystemId = fs.Id,
        BackupPolicyDetails = new Aws.Efs.Inputs.BackupPolicyBackupPolicyArgs
        {
            Status = "ENABLED",
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.efs.FileSystem;
import com.pulumi.aws.efs.BackupPolicy;
import com.pulumi.aws.efs.BackupPolicyArgs;
import com.pulumi.aws.efs.inputs.BackupPolicyBackupPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var fs = new FileSystem("fs");

        var policy = new BackupPolicy("policy", BackupPolicyArgs.builder()        
            .fileSystemId(fs.id())
            .backupPolicy(BackupPolicyBackupPolicyArgs.builder()
                .status("ENABLED")
                .build())
            .build());

    }
}
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",
    },
});
resources:
  fs:
    type: aws:efs:FileSystem
  policy:
    type: aws:efs:BackupPolicy
    properties:
      fileSystemId: ${fs.id}
      backupPolicy:
        status: ENABLED

Create 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)
public BackupPolicy(String name, BackupPolicyArgs args)
public BackupPolicy(String name, BackupPolicyArgs args, CustomResourceOptions options)
type: aws:efs:BackupPolicy
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args BackupPolicyArgs
The arguments to resource properties.
options 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 Pulumi.Aws.Efs.Inputs.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.

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.

backupPolicy Property Map

A backup_policy object (documented below).

fileSystemId String

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 string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up 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)
public static BackupPolicy get(String name, Output<String> id, BackupPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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 Pulumi.Aws.Efs.Inputs.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.

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.

backupPolicy Property Map

A backup_policy object (documented below).

fileSystemId String

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 string

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

status str

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

status String

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
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.