1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. VolumeBackupPolicyAssignment
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.Core.VolumeBackupPolicyAssignment

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

    This resource provides the Volume Backup Policy Assignment resource in Oracle Cloud Infrastructure Core service.

    Assigns a volume backup policy to the specified volume or volume group. Note that a given volume or volume group can only have one backup policy assigned to it. If this operation is used for a volume or volume group that already has a different backup policy assigned, the prior backup policy will be silently unassigned.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testVolumeBackupPolicyAssignment = new oci.core.VolumeBackupPolicyAssignment("test_volume_backup_policy_assignment", {
        assetId: testVolume.id,
        policyId: testVolumeBackupPolicy.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_volume_backup_policy_assignment = oci.core.VolumeBackupPolicyAssignment("test_volume_backup_policy_assignment",
        asset_id=test_volume["id"],
        policy_id=test_volume_backup_policy["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Core.NewVolumeBackupPolicyAssignment(ctx, "test_volume_backup_policy_assignment", &Core.VolumeBackupPolicyAssignmentArgs{
    			AssetId:  pulumi.Any(testVolume.Id),
    			PolicyId: pulumi.Any(testVolumeBackupPolicy.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testVolumeBackupPolicyAssignment = new Oci.Core.VolumeBackupPolicyAssignment("test_volume_backup_policy_assignment", new()
        {
            AssetId = testVolume.Id,
            PolicyId = testVolumeBackupPolicy.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.VolumeBackupPolicyAssignment;
    import com.pulumi.oci.Core.VolumeBackupPolicyAssignmentArgs;
    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 testVolumeBackupPolicyAssignment = new VolumeBackupPolicyAssignment("testVolumeBackupPolicyAssignment", VolumeBackupPolicyAssignmentArgs.builder()
                .assetId(testVolume.id())
                .policyId(testVolumeBackupPolicy.id())
                .build());
    
        }
    }
    
    resources:
      testVolumeBackupPolicyAssignment:
        type: oci:Core:VolumeBackupPolicyAssignment
        name: test_volume_backup_policy_assignment
        properties:
          assetId: ${testVolume.id}
          policyId: ${testVolumeBackupPolicy.id}
    

    Create VolumeBackupPolicyAssignment Resource

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

    Constructor syntax

    new VolumeBackupPolicyAssignment(name: string, args: VolumeBackupPolicyAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def VolumeBackupPolicyAssignment(resource_name: str,
                                     args: VolumeBackupPolicyAssignmentArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def VolumeBackupPolicyAssignment(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     asset_id: Optional[str] = None,
                                     policy_id: Optional[str] = None)
    func NewVolumeBackupPolicyAssignment(ctx *Context, name string, args VolumeBackupPolicyAssignmentArgs, opts ...ResourceOption) (*VolumeBackupPolicyAssignment, error)
    public VolumeBackupPolicyAssignment(string name, VolumeBackupPolicyAssignmentArgs args, CustomResourceOptions? opts = null)
    public VolumeBackupPolicyAssignment(String name, VolumeBackupPolicyAssignmentArgs args)
    public VolumeBackupPolicyAssignment(String name, VolumeBackupPolicyAssignmentArgs args, CustomResourceOptions options)
    
    type: oci:Core:VolumeBackupPolicyAssignment
    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 VolumeBackupPolicyAssignmentArgs
    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 VolumeBackupPolicyAssignmentArgs
    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 VolumeBackupPolicyAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VolumeBackupPolicyAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VolumeBackupPolicyAssignmentArgs
    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 volumeBackupPolicyAssignmentResource = new Oci.Core.VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource", new()
    {
        AssetId = "string",
        PolicyId = "string",
    });
    
    example, err := Core.NewVolumeBackupPolicyAssignment(ctx, "volumeBackupPolicyAssignmentResource", &Core.VolumeBackupPolicyAssignmentArgs{
    	AssetId:  pulumi.String("string"),
    	PolicyId: pulumi.String("string"),
    })
    
    var volumeBackupPolicyAssignmentResource = new VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource", VolumeBackupPolicyAssignmentArgs.builder()
        .assetId("string")
        .policyId("string")
        .build());
    
    volume_backup_policy_assignment_resource = oci.core.VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource",
        asset_id="string",
        policy_id="string")
    
    const volumeBackupPolicyAssignmentResource = new oci.core.VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource", {
        assetId: "string",
        policyId: "string",
    });
    
    type: oci:Core:VolumeBackupPolicyAssignment
    properties:
        assetId: string
        policyId: string
    

    VolumeBackupPolicyAssignment 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 VolumeBackupPolicyAssignment resource accepts the following input properties:

    AssetId string
    The OCID of the volume or volume group to assign the policy to.
    PolicyId string

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    AssetId string
    The OCID of the volume or volume group to assign the policy to.
    PolicyId string

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    assetId String
    The OCID of the volume or volume group to assign the policy to.
    policyId String

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    assetId string
    The OCID of the volume or volume group to assign the policy to.
    policyId string

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    asset_id str
    The OCID of the volume or volume group to assign the policy to.
    policy_id str

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    assetId String
    The OCID of the volume or volume group to assign the policy to.
    policyId String

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    TimeCreated string
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    Id string
    The provider-assigned unique ID for this managed resource.
    TimeCreated string
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    id String
    The provider-assigned unique ID for this managed resource.
    timeCreated String
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    id string
    The provider-assigned unique ID for this managed resource.
    timeCreated string
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    id str
    The provider-assigned unique ID for this managed resource.
    time_created str
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    id String
    The provider-assigned unique ID for this managed resource.
    timeCreated String
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.

    Look up Existing VolumeBackupPolicyAssignment Resource

    Get an existing VolumeBackupPolicyAssignment 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?: VolumeBackupPolicyAssignmentState, opts?: CustomResourceOptions): VolumeBackupPolicyAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            asset_id: Optional[str] = None,
            policy_id: Optional[str] = None,
            time_created: Optional[str] = None) -> VolumeBackupPolicyAssignment
    func GetVolumeBackupPolicyAssignment(ctx *Context, name string, id IDInput, state *VolumeBackupPolicyAssignmentState, opts ...ResourceOption) (*VolumeBackupPolicyAssignment, error)
    public static VolumeBackupPolicyAssignment Get(string name, Input<string> id, VolumeBackupPolicyAssignmentState? state, CustomResourceOptions? opts = null)
    public static VolumeBackupPolicyAssignment get(String name, Output<String> id, VolumeBackupPolicyAssignmentState 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:
    AssetId string
    The OCID of the volume or volume group to assign the policy to.
    PolicyId string

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    TimeCreated string
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    AssetId string
    The OCID of the volume or volume group to assign the policy to.
    PolicyId string

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    TimeCreated string
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    assetId String
    The OCID of the volume or volume group to assign the policy to.
    policyId String

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    timeCreated String
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    assetId string
    The OCID of the volume or volume group to assign the policy to.
    policyId string

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    timeCreated string
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    asset_id str
    The OCID of the volume or volume group to assign the policy to.
    policy_id str

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    time_created str
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
    assetId String
    The OCID of the volume or volume group to assign the policy to.
    policyId String

    The OCID of the volume backup policy to assign to the volume.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    timeCreated String
    The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.

    Import

    VolumeBackupPolicyAssignments can be imported using the id, e.g.

    $ pulumi import oci:Core/volumeBackupPolicyAssignment:VolumeBackupPolicyAssignment test_volume_backup_policy_assignment "id"
    

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

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi