ManagementLockByScopeArgs

data class ManagementLockByScopeArgs(val level: Output<Either<String, LockLevel>>? = null, val lockName: Output<String>? = null, val notes: Output<String>? = null, val owners: Output<List<ManagementLockOwnerArgs>>? = null, val scope: Output<String>? = null) : ConvertibleToJava<ManagementLockByScopeArgs>

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 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}

Constructors

Link copied to clipboard
constructor(level: Output<Either<String, LockLevel>>? = null, lockName: Output<String>? = null, notes: Output<String>? = null, owners: Output<List<ManagementLockOwnerArgs>>? = null, scope: Output<String>? = null)

Properties

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.

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 scope: Output<String>? = null

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.

Functions

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