oci.Core.VolumeBackupPolicyAssignment
Explore with Pulumi AI
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,
xrcKmsKeyId: testKey.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"],
xrc_kms_key_id=test_key["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),
XrcKmsKeyId: pulumi.Any(testKey.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,
XrcKmsKeyId = testKey.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())
.xrcKmsKeyId(testKey.id())
.build());
}
}
resources:
testVolumeBackupPolicyAssignment:
type: oci:Core:VolumeBackupPolicyAssignment
name: test_volume_backup_policy_assignment
properties:
assetId: ${testVolume.id}
policyId: ${testVolumeBackupPolicy.id}
xrcKmsKeyId: ${testKey.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,
xrc_kms_key_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",
XrcKmsKeyId = "string",
});
example, err := Core.NewVolumeBackupPolicyAssignment(ctx, "volumeBackupPolicyAssignmentResource", &Core.VolumeBackupPolicyAssignmentArgs{
AssetId: pulumi.String("string"),
PolicyId: pulumi.String("string"),
XrcKmsKeyId: pulumi.String("string"),
})
var volumeBackupPolicyAssignmentResource = new VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource", VolumeBackupPolicyAssignmentArgs.builder()
.assetId("string")
.policyId("string")
.xrcKmsKeyId("string")
.build());
volume_backup_policy_assignment_resource = oci.core.VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource",
asset_id="string",
policy_id="string",
xrc_kms_key_id="string")
const volumeBackupPolicyAssignmentResource = new oci.core.VolumeBackupPolicyAssignment("volumeBackupPolicyAssignmentResource", {
assetId: "string",
policyId: "string",
xrcKmsKeyId: "string",
});
type: oci:Core:VolumeBackupPolicyAssignment
properties:
assetId: string
policyId: string
xrcKmsKeyId: 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VolumeBackupPolicyAssignment resource accepts the following input properties:
- Asset
Id string - The OCID of the volume or volume group to assign the policy to.
- Policy
Id string - The OCID of the volume backup policy to assign to the volume.
- Xrc
Kms stringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 string - The OCID of the volume or volume group to assign the policy to.
- Policy
Id string - The OCID of the volume backup policy to assign to the volume.
- Xrc
Kms stringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 String - The OCID of the volume or volume group to assign the policy to.
- policy
Id String - The OCID of the volume backup policy to assign to the volume.
- xrc
Kms StringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 string - The OCID of the volume or volume group to assign the policy to.
- policy
Id string - The OCID of the volume backup policy to assign to the volume.
- xrc
Kms stringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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.
- xrc_
kms_ strkey_ id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 String - The OCID of the volume or volume group to assign the policy to.
- policy
Id String - The OCID of the volume backup policy to assign to the volume.
- xrc
Kms StringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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.
- Time
Created 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.
- Time
Created 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.
- time
Created 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.
- time
Created 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.
- time
Created 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,
xrc_kms_key_id: 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.
- Asset
Id string - The OCID of the volume or volume group to assign the policy to.
- Policy
Id string - The OCID of the volume backup policy to assign to the volume.
- Time
Created string - The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
- Xrc
Kms stringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 string - The OCID of the volume or volume group to assign the policy to.
- Policy
Id string - The OCID of the volume backup policy to assign to the volume.
- Time
Created string - The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
- Xrc
Kms stringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 String - The OCID of the volume or volume group to assign the policy to.
- policy
Id String - The OCID of the volume backup policy to assign to the volume.
- time
Created String - The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
- xrc
Kms StringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 string - The OCID of the volume or volume group to assign the policy to.
- policy
Id string - The OCID of the volume backup policy to assign to the volume.
- time
Created string - The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
- xrc
Kms stringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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.
- time_
created str - The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
- xrc_
kms_ strkey_ id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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 String - The OCID of the volume or volume group to assign the policy to.
- policy
Id String - The OCID of the volume backup policy to assign to the volume.
- time
Created String - The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339.
- xrc
Kms StringKey Id The OCID of the Vault service key which is the master encryption key for the block / boot volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see Overview of Vault service and Using Keys.
** 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
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.