Protection Container
Base class for container with backup items. Containers with specific workloads are derived from this class. Azure REST API version: 2023-04-01. Prior API version in Azure Native 1.x: 2021-02-01.
Example Usage
RegisterAzure Storage ProtectionContainers
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionContainer = new AzureNative.RecoveryServices.ProtectionContainer("protectionContainer", new()
{
ContainerName = "StorageContainer;Storage;SwaggerTestRg;swaggertestsa",
FabricName = "Azure",
Properties = new AzureNative.RecoveryServices.Inputs.AzureStorageContainerArgs
{
AcquireStorageAccountLock = "Acquire",
BackupManagementType = "AzureStorage",
ContainerType = "StorageContainer",
FriendlyName = "swaggertestsa",
SourceResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa",
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "swaggertestvault",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionContainer(ctx, "protectionContainer", &recoveryservices.ProtectionContainerArgs{
ContainerName: pulumi.String("StorageContainer;Storage;SwaggerTestRg;swaggertestsa"),
FabricName: pulumi.String("Azure"),
Properties: recoveryservices.AzureStorageContainer{
AcquireStorageAccountLock: "Acquire",
BackupManagementType: "AzureStorage",
ContainerType: "StorageContainer",
FriendlyName: "swaggertestsa",
SourceResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa",
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("swaggertestvault"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionContainer;
import com.pulumi.azurenative.recoveryservices.ProtectionContainerArgs;
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 protectionContainer = new ProtectionContainer("protectionContainer", ProtectionContainerArgs.builder()
.containerName("StorageContainer;Storage;SwaggerTestRg;swaggertestsa")
.fabricName("Azure")
.properties(Map.ofEntries(
Map.entry("acquireStorageAccountLock", "Acquire"),
Map.entry("backupManagementType", "AzureStorage"),
Map.entry("containerType", "StorageContainer"),
Map.entry("friendlyName", "swaggertestsa"),
Map.entry("sourceResourceId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa")
))
.resourceGroupName("SwaggerTestRg")
.vaultName("swaggertestvault")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:recoveryservices:ProtectionContainer StorageContainer;Storage;SwaggerTestRg;swaggertestsa /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}
Content copied to clipboard