ManagementLockAtResourceLevelArgs

data class ManagementLockAtResourceLevelArgs(val apiVersion: Output<String>? = null, val level: Output<Either<String, LockLevel>>? = null, val lockName: Output<String>? = null, val notes: Output<String>? = null, val owners: Output<List<ManagementLockOwnerArgs>>? = null, val parentResourcePath: Output<String>? = null, val resourceGroupName: Output<String>? = null, val resourceName: Output<String>? = null, val resourceProviderNamespace: Output<String>? = null, val resourceType: Output<String>? = null) : ConvertibleToJava<ManagementLockAtResourceLevelArgs>

The lock information. Uses Azure REST API version 2020-05-01. In version 2.x of the Azure Native provider, it used API version 2020-05-01.

Example Usage

Create management lock at resource level

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var managementLockAtResourceLevel = new AzureNative.Authorization.ManagementLockAtResourceLevel("managementLockAtResourceLevel", new()
{
Level = AzureNative.Authorization.LockLevel.ReadOnly,
LockName = "testlock",
ParentResourcePath = "parentResourcePath",
ResourceGroupName = "resourcegroupname",
ResourceName = "teststorageaccount",
ResourceProviderNamespace = "Microsoft.Storage",
ResourceType = "storageAccounts",
});
});
package main
import (
authorization "github.com/pulumi/pulumi-azure-native-sdk/authorization/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := authorization.NewManagementLockAtResourceLevel(ctx, "managementLockAtResourceLevel", &authorization.ManagementLockAtResourceLevelArgs{
Level: pulumi.String(authorization.LockLevelReadOnly),
LockName: pulumi.String("testlock"),
ParentResourcePath: pulumi.String("parentResourcePath"),
ResourceGroupName: pulumi.String("resourcegroupname"),
ResourceName: pulumi.String("teststorageaccount"),
ResourceProviderNamespace: pulumi.String("Microsoft.Storage"),
ResourceType: pulumi.String("storageAccounts"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.authorization.ManagementLockAtResourceLevel;
import com.pulumi.azurenative.authorization.ManagementLockAtResourceLevelArgs;
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 managementLockAtResourceLevel = new ManagementLockAtResourceLevel("managementLockAtResourceLevel", ManagementLockAtResourceLevelArgs.builder()
.level("ReadOnly")
.lockName("testlock")
.parentResourcePath("parentResourcePath")
.resourceGroupName("resourcegroupname")
.resourceName("teststorageaccount")
.resourceProviderNamespace("Microsoft.Storage")
.resourceType("storageAccounts")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:authorization:ManagementLockAtResourceLevel testlock /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}

Constructors

Link copied to clipboard
constructor(apiVersion: Output<String>? = null, level: Output<Either<String, LockLevel>>? = null, lockName: Output<String>? = null, notes: Output<String>? = null, owners: Output<List<ManagementLockOwnerArgs>>? = null, parentResourcePath: Output<String>? = null, resourceGroupName: Output<String>? = null, resourceName: Output<String>? = null, resourceProviderNamespace: Output<String>? = null, resourceType: Output<String>? = null)

Properties

Link copied to clipboard
val apiVersion: Output<String>? = null

The API version to use for this operation.

Link copied to clipboard
val level: Output<Either<String, LockLevel>>? = null

The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.

Link copied to clipboard
val lockName: Output<String>? = null

The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, %, &, :, \, ?, /, or any control characters.

Link copied to clipboard
val notes: Output<String>? = null

Notes about the lock. Maximum of 512 characters.

Link copied to clipboard
val owners: Output<List<ManagementLockOwnerArgs>>? = null

The owners of the lock.

Link copied to clipboard
val parentResourcePath: Output<String>? = null

The parent resource identity.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group containing the resource to lock.

Link copied to clipboard
val resourceName: Output<String>? = null

The name of the resource to lock.

Link copied to clipboard
val resourceProviderNamespace: Output<String>? = null

The resource provider namespace of the resource to lock.

Link copied to clipboard
val resourceType: Output<String>? = null

The resource type of the resource to lock.

Functions

Link copied to clipboard
open override fun toJava(): ManagementLockAtResourceLevelArgs