ManangementLock

class ManangementLock : KotlinCustomResource

Deprecated

azure.managementresource.ManangementLock has been deprecated in favor of azure.management.Lock

Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource.

Example Usage

Subscription Level Lock)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
import com.pulumi.azure.management.Lock;
import com.pulumi.azure.management.LockArgs;
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) {
final var current = CoreFunctions.getSubscription();
var subscription_level = new Lock("subscription-level", LockArgs.builder()
.scope(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.lockLevel("CanNotDelete")
.notes("Items can't be deleted in this subscription!")
.build());
}
}

Resource Group Level Lock)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.management.Lock;
import com.pulumi.azure.management.LockArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var resource_group_level = new Lock("resource-group-level", LockArgs.builder()
.scope(example.id())
.lockLevel("ReadOnly")
.notes("This Resource Group is Read-Only")
.build());
}
}

Resource Level Lock)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.PublicIp;
import com.pulumi.azure.network.PublicIpArgs;
import com.pulumi.azure.management.Lock;
import com.pulumi.azure.management.LockArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.allocationMethod("Static")
.idleTimeoutInMinutes(30)
.build());
var public_ip = new Lock("public-ip", LockArgs.builder()
.scope(examplePublicIp.id())
.lockLevel("CanNotDelete")
.notes("Locked because it's needed by a third-party")
.build());
}
}

Import

Management Locks can be imported using the resource id, e.g.

$ pulumi import azure:managementresource/manangementLock:ManangementLock lock1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Authorization/locks/lock1

Properties

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

Specifies the Level to be used for this Lock. Possible values are CanNotDelete and ReadOnly. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>

Specifies the name of the Management Lock. Changing this forces a new resource to be created.

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

Specifies some notes about the lock. Maximum of 512 characters. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scope: Output<String>

Specifies the scope at which the Management Lock should be created. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>