Management Lock At Resource Level Args
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/v3"
"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
Properties
The API version to use for this operation.
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.
The owners of the lock.
The parent resource identity.
The name of the resource group containing the resource to lock.
The name of the resource to lock.
The resource provider namespace of the resource to lock.
The resource type of the resource to lock.