ManagementLockAtResourceLevel

class ManagementLockAtResourceLevel : KotlinCustomResource

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}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val level: Output<String>

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 name: Output<String>

The name of the lock.

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

Notes about the lock. Maximum of 512 characters.

Link copied to clipboard

The owners of the lock.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Metadata pertaining to creation and last modification of the resource.

Link copied to clipboard
val type: Output<String>

The resource type of the lock - Microsoft.Authorization/locks.

Link copied to clipboard
val urn: Output<String>