1. Packages
  2. Azure Native
  3. API Docs
  4. authorization
  5. ManagementLockAtResourceGroupLevel
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

azure-native.authorization.ManagementLockAtResourceGroupLevel

Explore with Pulumi AI

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 group level

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var managementLockAtResourceGroupLevel = new AzureNative.Authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevel", new()
    {
        Level = AzureNative.Authorization.LockLevel.ReadOnly,
        LockName = "testlock",
        ResourceGroupName = "resourcegroupname",
    });

});
Copy
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.NewManagementLockAtResourceGroupLevel(ctx, "managementLockAtResourceGroupLevel", &authorization.ManagementLockAtResourceGroupLevelArgs{
			Level:             pulumi.String(authorization.LockLevelReadOnly),
			LockName:          pulumi.String("testlock"),
			ResourceGroupName: pulumi.String("resourcegroupname"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.authorization.ManagementLockAtResourceGroupLevel;
import com.pulumi.azurenative.authorization.ManagementLockAtResourceGroupLevelArgs;
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 managementLockAtResourceGroupLevel = new ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevel", ManagementLockAtResourceGroupLevelArgs.builder()
            .level("ReadOnly")
            .lockName("testlock")
            .resourceGroupName("resourcegroupname")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const managementLockAtResourceGroupLevel = new azure_native.authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevel", {
    level: azure_native.authorization.LockLevel.ReadOnly,
    lockName: "testlock",
    resourceGroupName: "resourcegroupname",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

management_lock_at_resource_group_level = azure_native.authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevel",
    level=azure_native.authorization.LockLevel.READ_ONLY,
    lock_name="testlock",
    resource_group_name="resourcegroupname")
Copy
resources:
  managementLockAtResourceGroupLevel:
    type: azure-native:authorization:ManagementLockAtResourceGroupLevel
    properties:
      level: ReadOnly
      lockName: testlock
      resourceGroupName: resourcegroupname
Copy

Create ManagementLockAtResourceGroupLevel Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ManagementLockAtResourceGroupLevel(name: string, args: ManagementLockAtResourceGroupLevelArgs, opts?: CustomResourceOptions);
@overload
def ManagementLockAtResourceGroupLevel(resource_name: str,
                                       args: ManagementLockAtResourceGroupLevelArgs,
                                       opts: Optional[ResourceOptions] = None)

@overload
def ManagementLockAtResourceGroupLevel(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       level: Optional[Union[str, LockLevel]] = None,
                                       resource_group_name: Optional[str] = None,
                                       lock_name: Optional[str] = None,
                                       notes: Optional[str] = None,
                                       owners: Optional[Sequence[ManagementLockOwnerArgs]] = None)
func NewManagementLockAtResourceGroupLevel(ctx *Context, name string, args ManagementLockAtResourceGroupLevelArgs, opts ...ResourceOption) (*ManagementLockAtResourceGroupLevel, error)
public ManagementLockAtResourceGroupLevel(string name, ManagementLockAtResourceGroupLevelArgs args, CustomResourceOptions? opts = null)
public ManagementLockAtResourceGroupLevel(String name, ManagementLockAtResourceGroupLevelArgs args)
public ManagementLockAtResourceGroupLevel(String name, ManagementLockAtResourceGroupLevelArgs args, CustomResourceOptions options)
type: azure-native:authorization:ManagementLockAtResourceGroupLevel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ManagementLockAtResourceGroupLevelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ManagementLockAtResourceGroupLevelArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ManagementLockAtResourceGroupLevelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ManagementLockAtResourceGroupLevelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ManagementLockAtResourceGroupLevelArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var managementLockAtResourceGroupLevelResource = new AzureNative.Authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevelResource", new()
{
    Level = "string",
    ResourceGroupName = "string",
    LockName = "string",
    Notes = "string",
    Owners = new[]
    {
        new AzureNative.Authorization.Inputs.ManagementLockOwnerArgs
        {
            ApplicationId = "string",
        },
    },
});
Copy
example, err := authorization.NewManagementLockAtResourceGroupLevel(ctx, "managementLockAtResourceGroupLevelResource", &authorization.ManagementLockAtResourceGroupLevelArgs{
	Level:             pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	LockName:          pulumi.String("string"),
	Notes:             pulumi.String("string"),
	Owners: authorization.ManagementLockOwnerArray{
		&authorization.ManagementLockOwnerArgs{
			ApplicationId: pulumi.String("string"),
		},
	},
})
Copy
var managementLockAtResourceGroupLevelResource = new ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevelResource", ManagementLockAtResourceGroupLevelArgs.builder()
    .level("string")
    .resourceGroupName("string")
    .lockName("string")
    .notes("string")
    .owners(ManagementLockOwnerArgs.builder()
        .applicationId("string")
        .build())
    .build());
Copy
management_lock_at_resource_group_level_resource = azure_native.authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevelResource",
    level="string",
    resource_group_name="string",
    lock_name="string",
    notes="string",
    owners=[{
        "application_id": "string",
    }])
Copy
const managementLockAtResourceGroupLevelResource = new azure_native.authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevelResource", {
    level: "string",
    resourceGroupName: "string",
    lockName: "string",
    notes: "string",
    owners: [{
        applicationId: "string",
    }],
});
Copy
type: azure-native:authorization:ManagementLockAtResourceGroupLevel
properties:
    level: string
    lockName: string
    notes: string
    owners:
        - applicationId: string
    resourceGroupName: string
Copy

ManagementLockAtResourceGroupLevel Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ManagementLockAtResourceGroupLevel resource accepts the following input properties:

Level This property is required. string | Pulumi.AzureNative.Authorization.LockLevel
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.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group to lock.
LockName Changes to this property will trigger replacement. string
The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, , ?, /, or any control characters.
Notes string
Notes about the lock. Maximum of 512 characters.
Owners List<Pulumi.AzureNative.Authorization.Inputs.ManagementLockOwner>
The owners of the lock.
Level This property is required. string | LockLevel
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.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group to lock.
LockName Changes to this property will trigger replacement. string
The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, , ?, /, or any control characters.
Notes string
Notes about the lock. Maximum of 512 characters.
Owners []ManagementLockOwnerArgs
The owners of the lock.
level This property is required. String | LockLevel
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.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group to lock.
lockName Changes to this property will trigger replacement. String
The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, , ?, /, or any control characters.
notes String
Notes about the lock. Maximum of 512 characters.
owners List<ManagementLockOwner>
The owners of the lock.
level This property is required. string | LockLevel
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.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group to lock.
lockName Changes to this property will trigger replacement. string
The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, , ?, /, or any control characters.
notes string
Notes about the lock. Maximum of 512 characters.
owners ManagementLockOwner[]
The owners of the lock.
level This property is required. str | LockLevel
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.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group to lock.
lock_name Changes to this property will trigger replacement. str
The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, , ?, /, or any control characters.
notes str
Notes about the lock. Maximum of 512 characters.
owners Sequence[ManagementLockOwnerArgs]
The owners of the lock.
level This property is required. String | "NotSpecified" | "CanNotDelete" | "ReadOnly"
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.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group to lock.
lockName Changes to this property will trigger replacement. String
The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, , ?, /, or any control characters.
notes String
Notes about the lock. Maximum of 512 characters.
owners List<Property Map>
The owners of the lock.

Outputs

All input properties are implicitly available as output properties. Additionally, the ManagementLockAtResourceGroupLevel resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the lock.
SystemData Pulumi.AzureNative.Authorization.Outputs.SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
The resource type of the lock - Microsoft.Authorization/locks.
AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the lock.
SystemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
The resource type of the lock - Microsoft.Authorization/locks.
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the lock.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type String
The resource type of the lock - Microsoft.Authorization/locks.
azureApiVersion string
The Azure API version of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the lock.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type string
The resource type of the lock - Microsoft.Authorization/locks.
azure_api_version str
The Azure API version of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the lock.
system_data SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type str
The resource type of the lock - Microsoft.Authorization/locks.
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the lock.
systemData Property Map
Metadata pertaining to creation and last modification of the resource.
type String
The resource type of the lock - Microsoft.Authorization/locks.

Supporting Types

LockLevel
, LockLevelArgs

NotSpecified
NotSpecified
CanNotDelete
CanNotDelete
ReadOnly
ReadOnly
LockLevelNotSpecified
NotSpecified
LockLevelCanNotDelete
CanNotDelete
LockLevelReadOnly
ReadOnly
NotSpecified
NotSpecified
CanNotDelete
CanNotDelete
ReadOnly
ReadOnly
NotSpecified
NotSpecified
CanNotDelete
CanNotDelete
ReadOnly
ReadOnly
NOT_SPECIFIED
NotSpecified
CAN_NOT_DELETE
CanNotDelete
READ_ONLY
ReadOnly
"NotSpecified"
NotSpecified
"CanNotDelete"
CanNotDelete
"ReadOnly"
ReadOnly

ManagementLockOwner
, ManagementLockOwnerArgs

ApplicationId string
The application ID of the lock owner.
ApplicationId string
The application ID of the lock owner.
applicationId String
The application ID of the lock owner.
applicationId string
The application ID of the lock owner.
application_id str
The application ID of the lock owner.
applicationId String
The application ID of the lock owner.

ManagementLockOwnerResponse
, ManagementLockOwnerResponseArgs

ApplicationId string
The application ID of the lock owner.
ApplicationId string
The application ID of the lock owner.
applicationId String
The application ID of the lock owner.
applicationId string
The application ID of the lock owner.
application_id str
The application ID of the lock owner.
applicationId String
The application ID of the lock owner.

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource last modification (UTC)
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:authorization:ManagementLockAtResourceGroupLevel testlock /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0