We recommend using Azure Native.
azure.siterecovery.HyperVSite
Explore with Pulumi AI
Manages a HyperV Site in Recovery Service Vault.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-rg",
location: "eastus",
});
const exampleVault = new azure.recoveryservices.Vault("example", {
name: "example-vault",
location: example.location,
resourceGroupName: example.name,
sku: "Standard",
softDeleteEnabled: false,
});
const exampleHyperVSite = new azure.siterecovery.HyperVSite("example", {
name: "example-site",
recoveryVaultId: exampleVault.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-rg",
location="eastus")
example_vault = azure.recoveryservices.Vault("example",
name="example-vault",
location=example.location,
resource_group_name=example.name,
sku="Standard",
soft_delete_enabled=False)
example_hyper_v_site = azure.siterecovery.HyperVSite("example",
name="example-site",
recovery_vault_id=example_vault.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/recoveryservices"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/siterecovery"
"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-rg"),
Location: pulumi.String("eastus"),
})
if err != nil {
return err
}
exampleVault, err := recoveryservices.NewVault(ctx, "example", &recoveryservices.VaultArgs{
Name: pulumi.String("example-vault"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("Standard"),
SoftDeleteEnabled: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = siterecovery.NewHyperVSite(ctx, "example", &siterecovery.HyperVSiteArgs{
Name: pulumi.String("example-site"),
RecoveryVaultId: exampleVault.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-rg",
Location = "eastus",
});
var exampleVault = new Azure.RecoveryServices.Vault("example", new()
{
Name = "example-vault",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "Standard",
SoftDeleteEnabled = false,
});
var exampleHyperVSite = new Azure.SiteRecovery.HyperVSite("example", new()
{
Name = "example-site",
RecoveryVaultId = exampleVault.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.recoveryservices.Vault;
import com.pulumi.azure.recoveryservices.VaultArgs;
import com.pulumi.azure.siterecovery.HyperVSite;
import com.pulumi.azure.siterecovery.HyperVSiteArgs;
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-rg")
.location("eastus")
.build());
var exampleVault = new Vault("exampleVault", VaultArgs.builder()
.name("example-vault")
.location(example.location())
.resourceGroupName(example.name())
.sku("Standard")
.softDeleteEnabled(false)
.build());
var exampleHyperVSite = new HyperVSite("exampleHyperVSite", HyperVSiteArgs.builder()
.name("example-site")
.recoveryVaultId(exampleVault.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-rg
location: eastus
exampleVault:
type: azure:recoveryservices:Vault
name: example
properties:
name: example-vault
location: ${example.location}
resourceGroupName: ${example.name}
sku: Standard
softDeleteEnabled: false
exampleHyperVSite:
type: azure:siterecovery:HyperVSite
name: example
properties:
name: example-site
recoveryVaultId: ${exampleVault.id}
Create HyperVSite Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HyperVSite(name: string, args: HyperVSiteArgs, opts?: CustomResourceOptions);
@overload
def HyperVSite(resource_name: str,
args: HyperVSiteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HyperVSite(resource_name: str,
opts: Optional[ResourceOptions] = None,
recovery_vault_id: Optional[str] = None,
name: Optional[str] = None)
func NewHyperVSite(ctx *Context, name string, args HyperVSiteArgs, opts ...ResourceOption) (*HyperVSite, error)
public HyperVSite(string name, HyperVSiteArgs args, CustomResourceOptions? opts = null)
public HyperVSite(String name, HyperVSiteArgs args)
public HyperVSite(String name, HyperVSiteArgs args, CustomResourceOptions options)
type: azure:siterecovery:HyperVSite
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 HyperVSiteArgs
- 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 HyperVSiteArgs
- 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 HyperVSiteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HyperVSiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HyperVSiteArgs
- 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 hyperVSiteResource = new Azure.SiteRecovery.HyperVSite("hyperVSiteResource", new()
{
RecoveryVaultId = "string",
Name = "string",
});
example, err := siterecovery.NewHyperVSite(ctx, "hyperVSiteResource", &siterecovery.HyperVSiteArgs{
RecoveryVaultId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var hyperVSiteResource = new HyperVSite("hyperVSiteResource", HyperVSiteArgs.builder()
.recoveryVaultId("string")
.name("string")
.build());
hyper_v_site_resource = azure.siterecovery.HyperVSite("hyperVSiteResource",
recovery_vault_id="string",
name="string")
const hyperVSiteResource = new azure.siterecovery.HyperVSite("hyperVSiteResource", {
recoveryVaultId: "string",
name: "string",
});
type: azure:siterecovery:HyperVSite
properties:
name: string
recoveryVaultId: string
HyperVSite 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 HyperVSite resource accepts the following input properties:
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- Name string
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- Name string
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name String
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery
Vault stringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name string
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery_
vault_ strid - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name str
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name String
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the HyperVSite 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 HyperVSite Resource
Get an existing HyperVSite 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?: HyperVSiteState, opts?: CustomResourceOptions): HyperVSite
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
recovery_vault_id: Optional[str] = None) -> HyperVSite
func GetHyperVSite(ctx *Context, name string, id IDInput, state *HyperVSiteState, opts ...ResourceOption) (*HyperVSite, error)
public static HyperVSite Get(string name, Input<string> id, HyperVSiteState? state, CustomResourceOptions? opts = null)
public static HyperVSite get(String name, Output<String> id, HyperVSiteState 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.
- Name string
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- Name string
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name String
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name string
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery
Vault stringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name str
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery_
vault_ strid - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
- name String
- The name which should be used for this Recovery Service. Changing this forces a new Site to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the Site created. Changing this forces a new Site to be created.
Import
Recovery Services can be imported using the resource id
, e.g.
$ pulumi import azure:siterecovery/hyperVSite:HyperVSite example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/fabric1
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.