1. Packages
  2. Azure Classic
  3. API Docs
  4. siterecovery
  5. getProtectionContainer

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.siterecovery.getProtectionContainer

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Use this data source to access information about an existing site recovery services protection container.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const container = azure.siterecovery.getProtectionContainer({
        name: "primary-container",
        recoveryVaultName: "tfex-recovery_vault",
        resourceGroupName: "tfex-resource_group",
        recoveryFabricName: "primary-fabric",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    container = azure.siterecovery.get_protection_container(name="primary-container",
        recovery_vault_name="tfex-recovery_vault",
        resource_group_name="tfex-resource_group",
        recovery_fabric_name="primary-fabric")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := siterecovery.LookupProtectionContainer(ctx, &siterecovery.LookupProtectionContainerArgs{
    			Name:               "primary-container",
    			RecoveryVaultName:  "tfex-recovery_vault",
    			ResourceGroupName:  "tfex-resource_group",
    			RecoveryFabricName: "primary-fabric",
    		}, nil)
    		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 container = Azure.SiteRecovery.GetProtectionContainer.Invoke(new()
        {
            Name = "primary-container",
            RecoveryVaultName = "tfex-recovery_vault",
            ResourceGroupName = "tfex-resource_group",
            RecoveryFabricName = "primary-fabric",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.siterecovery.SiterecoveryFunctions;
    import com.pulumi.azure.siterecovery.inputs.GetProtectionContainerArgs;
    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) {
            final var container = SiterecoveryFunctions.getProtectionContainer(GetProtectionContainerArgs.builder()
                .name("primary-container")
                .recoveryVaultName("tfex-recovery_vault")
                .resourceGroupName("tfex-resource_group")
                .recoveryFabricName("primary-fabric")
                .build());
    
        }
    }
    
    variables:
      container:
        fn::invoke:
          Function: azure:siterecovery:getProtectionContainer
          Arguments:
            name: primary-container
            recoveryVaultName: tfex-recovery_vault
            resourceGroupName: tfex-resource_group
            recoveryFabricName: primary-fabric
    

    Using getProtectionContainer

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProtectionContainer(args: GetProtectionContainerArgs, opts?: InvokeOptions): Promise<GetProtectionContainerResult>
    function getProtectionContainerOutput(args: GetProtectionContainerOutputArgs, opts?: InvokeOptions): Output<GetProtectionContainerResult>
    def get_protection_container(name: Optional[str] = None,
                                 recovery_fabric_name: Optional[str] = None,
                                 recovery_vault_name: Optional[str] = None,
                                 resource_group_name: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetProtectionContainerResult
    def get_protection_container_output(name: Optional[pulumi.Input[str]] = None,
                                 recovery_fabric_name: Optional[pulumi.Input[str]] = None,
                                 recovery_vault_name: Optional[pulumi.Input[str]] = None,
                                 resource_group_name: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetProtectionContainerResult]
    func LookupProtectionContainer(ctx *Context, args *LookupProtectionContainerArgs, opts ...InvokeOption) (*LookupProtectionContainerResult, error)
    func LookupProtectionContainerOutput(ctx *Context, args *LookupProtectionContainerOutputArgs, opts ...InvokeOption) LookupProtectionContainerResultOutput

    > Note: This function is named LookupProtectionContainer in the Go SDK.

    public static class GetProtectionContainer 
    {
        public static Task<GetProtectionContainerResult> InvokeAsync(GetProtectionContainerArgs args, InvokeOptions? opts = null)
        public static Output<GetProtectionContainerResult> Invoke(GetProtectionContainerInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProtectionContainerResult> getProtectionContainer(GetProtectionContainerArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:siterecovery/getProtectionContainer:getProtectionContainer
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the protection container.
    RecoveryFabricName string
    The name of the fabric that contains the protection container.
    RecoveryVaultName string
    The name of the Recovery Services Vault that the protection container is associated witth.
    ResourceGroupName string
    The name of the resource group in which the associated protection container resides.
    Name string
    Specifies the name of the protection container.
    RecoveryFabricName string
    The name of the fabric that contains the protection container.
    RecoveryVaultName string
    The name of the Recovery Services Vault that the protection container is associated witth.
    ResourceGroupName string
    The name of the resource group in which the associated protection container resides.
    name String
    Specifies the name of the protection container.
    recoveryFabricName String
    The name of the fabric that contains the protection container.
    recoveryVaultName String
    The name of the Recovery Services Vault that the protection container is associated witth.
    resourceGroupName String
    The name of the resource group in which the associated protection container resides.
    name string
    Specifies the name of the protection container.
    recoveryFabricName string
    The name of the fabric that contains the protection container.
    recoveryVaultName string
    The name of the Recovery Services Vault that the protection container is associated witth.
    resourceGroupName string
    The name of the resource group in which the associated protection container resides.
    name str
    Specifies the name of the protection container.
    recovery_fabric_name str
    The name of the fabric that contains the protection container.
    recovery_vault_name str
    The name of the Recovery Services Vault that the protection container is associated witth.
    resource_group_name str
    The name of the resource group in which the associated protection container resides.
    name String
    Specifies the name of the protection container.
    recoveryFabricName String
    The name of the fabric that contains the protection container.
    recoveryVaultName String
    The name of the Recovery Services Vault that the protection container is associated witth.
    resourceGroupName String
    The name of the resource group in which the associated protection container resides.

    getProtectionContainer Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    RecoveryFabricName string
    RecoveryVaultName string
    ResourceGroupName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    RecoveryFabricName string
    RecoveryVaultName string
    ResourceGroupName string
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    recoveryFabricName String
    recoveryVaultName String
    resourceGroupName String
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    recoveryFabricName string
    recoveryVaultName string
    resourceGroupName string
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    recovery_fabric_name str
    recovery_vault_name str
    resource_group_name str
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    recoveryFabricName String
    recoveryVaultName String
    resourceGroupName String

    Package Details

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

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi