We recommend using Azure Native.
azure.recoveryservices.VaultResourceGuardAssociation
Explore with Pulumi AI
Manages an association of a Resource Guard and Recovery Services Vault.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleResourceGuard = new azure.dataprotection.ResourceGuard("example", {
name: "example-resourceguard",
resourceGroupName: example.name,
location: example.location,
});
const vault = new azure.recoveryservices.Vault("vault", {
name: "example-recovery-vault",
location: example.location,
resourceGroupName: example.name,
sku: "Standard",
softDeleteEnabled: true,
});
const test = new azure.recoveryservices.VaultResourceGuardAssociation("test", {
vaultId: testAzurermRecoveryServicesVault.id,
resourceGuardId: testAzurermDataProtectionResourceGuard.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_resource_guard = azure.dataprotection.ResourceGuard("example",
name="example-resourceguard",
resource_group_name=example.name,
location=example.location)
vault = azure.recoveryservices.Vault("vault",
name="example-recovery-vault",
location=example.location,
resource_group_name=example.name,
sku="Standard",
soft_delete_enabled=True)
test = azure.recoveryservices.VaultResourceGuardAssociation("test",
vault_id=test_azurerm_recovery_services_vault["id"],
resource_guard_id=test_azurerm_data_protection_resource_guard["id"])
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/dataprotection"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/recoveryservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = dataprotection.NewResourceGuard(ctx, "example", &dataprotection.ResourceGuardArgs{
Name: pulumi.String("example-resourceguard"),
ResourceGroupName: example.Name,
Location: example.Location,
})
if err != nil {
return err
}
_, err = recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
Name: pulumi.String("example-recovery-vault"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("Standard"),
SoftDeleteEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = recoveryservices.NewVaultResourceGuardAssociation(ctx, "test", &recoveryservices.VaultResourceGuardAssociationArgs{
VaultId: pulumi.Any(testAzurermRecoveryServicesVault.Id),
ResourceGuardId: pulumi.Any(testAzurermDataProtectionResourceGuard.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleResourceGuard = new Azure.DataProtection.ResourceGuard("example", new()
{
Name = "example-resourceguard",
ResourceGroupName = example.Name,
Location = example.Location,
});
var vault = new Azure.RecoveryServices.Vault("vault", new()
{
Name = "example-recovery-vault",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "Standard",
SoftDeleteEnabled = true,
});
var test = new Azure.RecoveryServices.VaultResourceGuardAssociation("test", new()
{
VaultId = testAzurermRecoveryServicesVault.Id,
ResourceGuardId = testAzurermDataProtectionResourceGuard.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.dataprotection.ResourceGuard;
import com.pulumi.azure.dataprotection.ResourceGuardArgs;
import com.pulumi.azure.recoveryservices.Vault;
import com.pulumi.azure.recoveryservices.VaultArgs;
import com.pulumi.azure.recoveryservices.VaultResourceGuardAssociation;
import com.pulumi.azure.recoveryservices.VaultResourceGuardAssociationArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleResourceGuard = new ResourceGuard("exampleResourceGuard", ResourceGuardArgs.builder()
.name("example-resourceguard")
.resourceGroupName(example.name())
.location(example.location())
.build());
var vault = new Vault("vault", VaultArgs.builder()
.name("example-recovery-vault")
.location(example.location())
.resourceGroupName(example.name())
.sku("Standard")
.softDeleteEnabled(true)
.build());
var test = new VaultResourceGuardAssociation("test", VaultResourceGuardAssociationArgs.builder()
.vaultId(testAzurermRecoveryServicesVault.id())
.resourceGuardId(testAzurermDataProtectionResourceGuard.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleResourceGuard:
type: azure:dataprotection:ResourceGuard
name: example
properties:
name: example-resourceguard
resourceGroupName: ${example.name}
location: ${example.location}
vault:
type: azure:recoveryservices:Vault
properties:
name: example-recovery-vault
location: ${example.location}
resourceGroupName: ${example.name}
sku: Standard
softDeleteEnabled: true
test:
type: azure:recoveryservices:VaultResourceGuardAssociation
properties:
vaultId: ${testAzurermRecoveryServicesVault.id}
resourceGuardId: ${testAzurermDataProtectionResourceGuard.id}
Create VaultResourceGuardAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VaultResourceGuardAssociation(name: string, args: VaultResourceGuardAssociationArgs, opts?: CustomResourceOptions);
@overload
def VaultResourceGuardAssociation(resource_name: str,
args: VaultResourceGuardAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VaultResourceGuardAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_guard_id: Optional[str] = None,
vault_id: Optional[str] = None)
func NewVaultResourceGuardAssociation(ctx *Context, name string, args VaultResourceGuardAssociationArgs, opts ...ResourceOption) (*VaultResourceGuardAssociation, error)
public VaultResourceGuardAssociation(string name, VaultResourceGuardAssociationArgs args, CustomResourceOptions? opts = null)
public VaultResourceGuardAssociation(String name, VaultResourceGuardAssociationArgs args)
public VaultResourceGuardAssociation(String name, VaultResourceGuardAssociationArgs args, CustomResourceOptions options)
type: azure:recoveryservices:VaultResourceGuardAssociation
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 VaultResourceGuardAssociationArgs
- 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 VaultResourceGuardAssociationArgs
- 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 VaultResourceGuardAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VaultResourceGuardAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VaultResourceGuardAssociationArgs
- 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 vaultResourceGuardAssociationResource = new Azure.RecoveryServices.VaultResourceGuardAssociation("vaultResourceGuardAssociationResource", new()
{
ResourceGuardId = "string",
VaultId = "string",
});
example, err := recoveryservices.NewVaultResourceGuardAssociation(ctx, "vaultResourceGuardAssociationResource", &recoveryservices.VaultResourceGuardAssociationArgs{
ResourceGuardId: pulumi.String("string"),
VaultId: pulumi.String("string"),
})
var vaultResourceGuardAssociationResource = new VaultResourceGuardAssociation("vaultResourceGuardAssociationResource", VaultResourceGuardAssociationArgs.builder()
.resourceGuardId("string")
.vaultId("string")
.build());
vault_resource_guard_association_resource = azure.recoveryservices.VaultResourceGuardAssociation("vaultResourceGuardAssociationResource",
resource_guard_id="string",
vault_id="string")
const vaultResourceGuardAssociationResource = new azure.recoveryservices.VaultResourceGuardAssociation("vaultResourceGuardAssociationResource", {
resourceGuardId: "string",
vaultId: "string",
});
type: azure:recoveryservices:VaultResourceGuardAssociation
properties:
resourceGuardId: string
vaultId: string
VaultResourceGuardAssociation 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 VaultResourceGuardAssociation resource accepts the following input properties:
- Resource
Guard stringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- Vault
Id string - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- Resource
Guard stringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- Vault
Id string - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource
Guard StringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault
Id String - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource
Guard stringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault
Id string - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource_
guard_ strid - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault_
id str - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource
Guard StringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault
Id String - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the VaultResourceGuardAssociation 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 VaultResourceGuardAssociation Resource
Get an existing VaultResourceGuardAssociation 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?: VaultResourceGuardAssociationState, opts?: CustomResourceOptions): VaultResourceGuardAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
resource_guard_id: Optional[str] = None,
vault_id: Optional[str] = None) -> VaultResourceGuardAssociation
func GetVaultResourceGuardAssociation(ctx *Context, name string, id IDInput, state *VaultResourceGuardAssociationState, opts ...ResourceOption) (*VaultResourceGuardAssociation, error)
public static VaultResourceGuardAssociation Get(string name, Input<string> id, VaultResourceGuardAssociationState? state, CustomResourceOptions? opts = null)
public static VaultResourceGuardAssociation get(String name, Output<String> id, VaultResourceGuardAssociationState 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.
- Resource
Guard stringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- Vault
Id string - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- Resource
Guard stringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- Vault
Id string - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource
Guard StringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault
Id String - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource
Guard stringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault
Id string - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource_
guard_ strid - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault_
id str - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
- resource
Guard StringId - ID of the Resource Guard which should be associated with. Changing this forces a new resource to be created.
- vault
Id String - ID of the Recovery Services Vault which should be associated with. Changing this forces a new resource to be created.
Import
Resource Guards can be imported using the resource id
, e.g.
$ pulumi import azure:recoveryservices/vaultResourceGuardAssociation:VaultResourceGuardAssociation example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/vault1/backupResourceGuardProxies/proxy1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.