Management Lock By Scope Args
The lock information. Uses Azure REST API version 2020-05-01. In version 1.x of the Azure Native provider, it used API version 2017-04-01.
Example Usage
Create management lock at scope
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var managementLockByScope = new AzureNative.Authorization.ManagementLockByScope("managementLockByScope", new()
{
Level = AzureNative.Authorization.LockLevel.ReadOnly,
LockName = "testlock",
Scope = "subscriptions/subscriptionId",
});
});
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.NewManagementLockByScope(ctx, "managementLockByScope", &authorization.ManagementLockByScopeArgs{
Level: pulumi.String(authorization.LockLevelReadOnly),
LockName: pulumi.String("testlock"),
Scope: pulumi.String("subscriptions/subscriptionId"),
})
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.ManagementLockByScope;
import com.pulumi.azurenative.authorization.ManagementLockByScopeArgs;
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 managementLockByScope = new ManagementLockByScope("managementLockByScope", ManagementLockByScopeArgs.builder()
.level("ReadOnly")
.lockName("testlock")
.scope("subscriptions/subscriptionId")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:authorization:ManagementLockByScope testlock /{scope}/providers/Microsoft.Authorization/locks/{lockName}
Properties
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 scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources.