1. Packages
  2. AWS Classic
  3. API Docs
  4. efs
  5. BackupPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.efs.BackupPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const fs = new aws.efs.FileSystem("fs", {creationToken: "my-product"});
    const policy = new aws.efs.BackupPolicy("policy", {
        fileSystemId: fs.id,
        backupPolicy: {
            status: "ENABLED",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    fs = aws.efs.FileSystem("fs", creation_token="my-product")
    policy = aws.efs.BackupPolicy("policy",
        file_system_id=fs.id,
        backup_policy={
            "status": "ENABLED",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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", &efs.FileSystemArgs{
    			CreationToken: pulumi.String("my-product"),
    		})
    		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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var fs = new Aws.Efs.FileSystem("fs", new()
        {
            CreationToken = "my-product",
        });
    
        var policy = new Aws.Efs.BackupPolicy("policy", new()
        {
            FileSystemId = fs.Id,
            BackupPolicyDetails = new Aws.Efs.Inputs.BackupPolicyBackupPolicyArgs
            {
                Status = "ENABLED",
            },
        });
    
    });
    
    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.FileSystemArgs;
    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", FileSystemArgs.builder()
                .creationToken("my-product")
                .build());
    
            var policy = new BackupPolicy("policy", BackupPolicyArgs.builder()
                .fileSystemId(fs.id())
                .backupPolicy(BackupPolicyBackupPolicyArgs.builder()
                    .status("ENABLED")
                    .build())
                .build());
    
        }
    }
    
    resources:
      fs:
        type: aws:efs:FileSystem
        properties:
          creationToken: my-product
      policy:
        type: aws:efs:BackupPolicy
        properties:
          fileSystemId: ${fs.id}
          backupPolicy:
            status: ENABLED
    

    Create BackupPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BackupPolicy(name: string, args: BackupPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def BackupPolicy(resource_name: str,
                     args: BackupPolicyArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def BackupPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     backup_policy: Optional[BackupPolicyBackupPolicyArgs] = None,
                     file_system_id: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var backupPolicyResource = new Aws.Efs.BackupPolicy("backupPolicyResource", new()
    {
        BackupPolicyDetails = new Aws.Efs.Inputs.BackupPolicyBackupPolicyArgs
        {
            Status = "string",
        },
        FileSystemId = "string",
    });
    
    example, err := efs.NewBackupPolicy(ctx, "backupPolicyResource", &efs.BackupPolicyArgs{
    	BackupPolicy: &efs.BackupPolicyBackupPolicyArgs{
    		Status: pulumi.String("string"),
    	},
    	FileSystemId: pulumi.String("string"),
    })
    
    var backupPolicyResource = new BackupPolicy("backupPolicyResource", BackupPolicyArgs.builder()
        .backupPolicy(BackupPolicyBackupPolicyArgs.builder()
            .status("string")
            .build())
        .fileSystemId("string")
        .build());
    
    backup_policy_resource = aws.efs.BackupPolicy("backupPolicyResource",
        backup_policy={
            "status": "string",
        },
        file_system_id="string")
    
    const backupPolicyResource = new aws.efs.BackupPolicy("backupPolicyResource", {
        backupPolicy: {
            status: "string",
        },
        fileSystemId: "string",
    });
    
    type: aws:efs:BackupPolicy
    properties:
        backupPolicy:
            status: string
        fileSystemId: string
    

    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 BackupPolicyBackupPolicy
    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 BackupPolicyBackupPolicy
    A backup_policy object (documented below).
    fileSystemId String
    The ID of the EFS file system.
    backupPolicy BackupPolicyBackupPolicy
    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 BackupPolicyBackupPolicy
    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 BackupPolicyBackupPolicy
    A backup_policy object (documented below).
    fileSystemId String
    The ID of the EFS file system.
    backupPolicy BackupPolicyBackupPolicy
    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, BackupPolicyBackupPolicyArgs

    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

    Using pulumi import, import the EFS backup policies using the id. For example:

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi