Vault
Resource information, as returned by the resource provider. Azure REST API version: 2023-04-01. Prior API version in Azure Native 1.x: 2021-01-01. Other available API versions: 2020-02-02, 2023-06-01.
Example Usage
Create or Update Recovery Services vault
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var vault = new AzureNative.RecoveryServices.Vault("vault", new()
{
Identity = new AzureNative.RecoveryServices.Inputs.IdentityDataArgs
{
Type = "SystemAssigned",
},
Location = "West US",
Properties = new AzureNative.RecoveryServices.Inputs.VaultPropertiesArgs
{
PublicNetworkAccess = "Enabled",
},
ResourceGroupName = "Default-RecoveryServices-ResourceGroup",
Sku = new AzureNative.RecoveryServices.Inputs.SkuArgs
{
Name = "Standard",
},
VaultName = "swaggerExample",
});
});
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.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
Identity: &recoveryservices.IdentityDataArgs{
Type: pulumi.String("SystemAssigned"),
},
Location: pulumi.String("West US"),
Properties: &recoveryservices.VaultPropertiesArgs{
PublicNetworkAccess: pulumi.String("Enabled"),
},
ResourceGroupName: pulumi.String("Default-RecoveryServices-ResourceGroup"),
Sku: &recoveryservices.SkuArgs{
Name: pulumi.String("Standard"),
},
VaultName: pulumi.String("swaggerExample"),
})
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.Vault;
import com.pulumi.azurenative.recoveryservices.VaultArgs;
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 vault = new Vault("vault", VaultArgs.builder()
.identity(Map.of("type", "SystemAssigned"))
.location("West US")
.properties(Map.of("publicNetworkAccess", "Enabled"))
.resourceGroupName("Default-RecoveryServices-ResourceGroup")
.sku(Map.of("name", "Standard"))
.vaultName("swaggerExample")
.build());
}
}
Content copied to clipboard
Create or Update Vault With Monitoring Setting
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var vault = new AzureNative.RecoveryServices.Vault("vault", new()
{
Identity = new AzureNative.RecoveryServices.Inputs.IdentityDataArgs
{
Type = "SystemAssigned",
},
Location = "West US",
Properties = new AzureNative.RecoveryServices.Inputs.VaultPropertiesArgs
{
MonitoringSettings = new AzureNative.RecoveryServices.Inputs.MonitoringSettingsArgs
{
AzureMonitorAlertSettings = new AzureNative.RecoveryServices.Inputs.AzureMonitorAlertSettingsArgs
{
AlertsForAllJobFailures = "Enabled",
},
ClassicAlertSettings = new AzureNative.RecoveryServices.Inputs.ClassicAlertSettingsArgs
{
AlertsForCriticalOperations = "Disabled",
},
},
PublicNetworkAccess = "Enabled",
},
ResourceGroupName = "Default-RecoveryServices-ResourceGroup",
Sku = new AzureNative.RecoveryServices.Inputs.SkuArgs
{
Name = "Standard",
},
VaultName = "swaggerExample",
});
});
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.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
Identity: &recoveryservices.IdentityDataArgs{
Type: pulumi.String("SystemAssigned"),
},
Location: pulumi.String("West US"),
Properties: recoveryservices.VaultPropertiesResponse{
MonitoringSettings: interface{}{
AzureMonitorAlertSettings: &recoveryservices.AzureMonitorAlertSettingsArgs{
AlertsForAllJobFailures: pulumi.String("Enabled"),
},
ClassicAlertSettings: &recoveryservices.ClassicAlertSettingsArgs{
AlertsForCriticalOperations: pulumi.String("Disabled"),
},
},
PublicNetworkAccess: pulumi.String("Enabled"),
},
ResourceGroupName: pulumi.String("Default-RecoveryServices-ResourceGroup"),
Sku: &recoveryservices.SkuArgs{
Name: pulumi.String("Standard"),
},
VaultName: pulumi.String("swaggerExample"),
})
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.Vault;
import com.pulumi.azurenative.recoveryservices.VaultArgs;
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 vault = new Vault("vault", VaultArgs.builder()
.identity(Map.of("type", "SystemAssigned"))
.location("West US")
.properties(Map.ofEntries(
Map.entry("monitoringSettings", Map.ofEntries(
Map.entry("azureMonitorAlertSettings", Map.of("alertsForAllJobFailures", "Enabled")),
Map.entry("classicAlertSettings", Map.of("alertsForCriticalOperations", "Disabled"))
)),
Map.entry("publicNetworkAccess", "Enabled")
))
.resourceGroupName("Default-RecoveryServices-ResourceGroup")
.sku(Map.of("name", "Standard"))
.vaultName("swaggerExample")
.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:Vault swaggerExample /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}
Content copied to clipboard