azure-native.authorization.ManagementLockAtResourceLevel
Explore with Pulumi AI
The lock information. Azure REST API version: 2020-05-01. Prior API version in Azure Native 1.x: 2017-04-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/v2"
	"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 * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const managementLockAtResourceLevel = new azure_native.authorization.ManagementLockAtResourceLevel("managementLockAtResourceLevel", {
    level: azure_native.authorization.LockLevel.ReadOnly,
    lockName: "testlock",
    parentResourcePath: "parentResourcePath",
    resourceGroupName: "resourcegroupname",
    resourceName: "teststorageaccount",
    resourceProviderNamespace: "Microsoft.Storage",
    resourceType: "storageAccounts",
});
import pulumi
import pulumi_azure_native as azure_native
management_lock_at_resource_level = azure_native.authorization.ManagementLockAtResourceLevel("managementLockAtResourceLevel",
    level=azure_native.authorization.LockLevel.READ_ONLY,
    lock_name="testlock",
    parent_resource_path="parentResourcePath",
    resource_group_name="resourcegroupname",
    resource_name_="teststorageaccount",
    resource_provider_namespace="Microsoft.Storage",
    resource_type="storageAccounts")
resources:
  managementLockAtResourceLevel:
    type: azure-native:authorization:ManagementLockAtResourceLevel
    properties:
      level: ReadOnly
      lockName: testlock
      parentResourcePath: parentResourcePath
      resourceGroupName: resourcegroupname
      resourceName: teststorageaccount
      resourceProviderNamespace: Microsoft.Storage
      resourceType: storageAccounts
Create ManagementLockAtResourceLevel Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagementLockAtResourceLevel(name: string, args: ManagementLockAtResourceLevelArgs, opts?: CustomResourceOptions);@overload
def ManagementLockAtResourceLevel(resource_name: str,
                                  args: ManagementLockAtResourceLevelArgs,
                                  opts: Optional[ResourceOptions] = None)
@overload
def ManagementLockAtResourceLevel(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  api_version: Optional[str] = None,
                                  level: Optional[Union[str, LockLevel]] = None,
                                  parent_resource_path: Optional[str] = None,
                                  resource_group_name: Optional[str] = None,
                                  resource_name_: Optional[str] = None,
                                  resource_provider_namespace: Optional[str] = None,
                                  resource_type: Optional[str] = None,
                                  lock_name: Optional[str] = None,
                                  notes: Optional[str] = None,
                                  owners: Optional[Sequence[ManagementLockOwnerArgs]] = None)func NewManagementLockAtResourceLevel(ctx *Context, name string, args ManagementLockAtResourceLevelArgs, opts ...ResourceOption) (*ManagementLockAtResourceLevel, error)public ManagementLockAtResourceLevel(string name, ManagementLockAtResourceLevelArgs args, CustomResourceOptions? opts = null)
public ManagementLockAtResourceLevel(String name, ManagementLockAtResourceLevelArgs args)
public ManagementLockAtResourceLevel(String name, ManagementLockAtResourceLevelArgs args, CustomResourceOptions options)
type: azure-native:authorization:ManagementLockAtResourceLevel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ManagementLockAtResourceLevelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ManagementLockAtResourceLevelArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ManagementLockAtResourceLevelArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagementLockAtResourceLevelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagementLockAtResourceLevelArgs
- 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 managementLockAtResourceLevelResource = new AzureNative.Authorization.ManagementLockAtResourceLevel("managementLockAtResourceLevelResource", new()
{
    ApiVersion = "string",
    Level = "string",
    ParentResourcePath = "string",
    ResourceGroupName = "string",
    ResourceName = "string",
    ResourceProviderNamespace = "string",
    ResourceType = "string",
    LockName = "string",
    Notes = "string",
    Owners = new[]
    {
        new AzureNative.Authorization.Inputs.ManagementLockOwnerArgs
        {
            ApplicationId = "string",
        },
    },
});
example, err := authorization.NewManagementLockAtResourceLevel(ctx, "managementLockAtResourceLevelResource", &authorization.ManagementLockAtResourceLevelArgs{
	ApiVersion:                pulumi.String("string"),
	Level:                     pulumi.String("string"),
	ParentResourcePath:        pulumi.String("string"),
	ResourceGroupName:         pulumi.String("string"),
	ResourceName:              pulumi.String("string"),
	ResourceProviderNamespace: pulumi.String("string"),
	ResourceType:              pulumi.String("string"),
	LockName:                  pulumi.String("string"),
	Notes:                     pulumi.String("string"),
	Owners: authorization.ManagementLockOwnerArray{
		&authorization.ManagementLockOwnerArgs{
			ApplicationId: pulumi.String("string"),
		},
	},
})
var managementLockAtResourceLevelResource = new ManagementLockAtResourceLevel("managementLockAtResourceLevelResource", ManagementLockAtResourceLevelArgs.builder()
    .apiVersion("string")
    .level("string")
    .parentResourcePath("string")
    .resourceGroupName("string")
    .resourceName("string")
    .resourceProviderNamespace("string")
    .resourceType("string")
    .lockName("string")
    .notes("string")
    .owners(ManagementLockOwnerArgs.builder()
        .applicationId("string")
        .build())
    .build());
management_lock_at_resource_level_resource = azure_native.authorization.ManagementLockAtResourceLevel("managementLockAtResourceLevelResource",
    api_version="string",
    level="string",
    parent_resource_path="string",
    resource_group_name="string",
    resource_name_="string",
    resource_provider_namespace="string",
    resource_type="string",
    lock_name="string",
    notes="string",
    owners=[{
        "application_id": "string",
    }])
const managementLockAtResourceLevelResource = new azure_native.authorization.ManagementLockAtResourceLevel("managementLockAtResourceLevelResource", {
    apiVersion: "string",
    level: "string",
    parentResourcePath: "string",
    resourceGroupName: "string",
    resourceName: "string",
    resourceProviderNamespace: "string",
    resourceType: "string",
    lockName: "string",
    notes: "string",
    owners: [{
        applicationId: "string",
    }],
});
type: azure-native:authorization:ManagementLockAtResourceLevel
properties:
    apiVersion: string
    level: string
    lockName: string
    notes: string
    owners:
        - applicationId: string
    parentResourcePath: string
    resourceGroupName: string
    resourceName: string
    resourceProviderNamespace: string
    resourceType: string
ManagementLockAtResourceLevel 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 ManagementLockAtResourceLevel resource accepts the following input properties:
- ApiVersion string
- The API version to use for this operation.
- Level
string | Pulumi.Azure Native. Authorization. Lock Level 
- 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.
- ParentResource stringPath 
- The parent resource identity.
- ResourceGroup stringName 
- The name of the resource group containing the resource to lock.
- ResourceName string
- The name of the resource to lock.
- ResourceProvider stringNamespace 
- The resource provider namespace of the resource to lock.
- ResourceType string
- The resource type of the resource to lock.
- LockName string
- The name of lock. 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.Azure Native. Authorization. Inputs. Management Lock Owner> 
- The owners of the lock.
- ApiVersion string
- The API version to use for this operation.
- Level
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.
- ParentResource stringPath 
- The parent resource identity.
- ResourceGroup stringName 
- The name of the resource group containing the resource to lock.
- ResourceName string
- The name of the resource to lock.
- ResourceProvider stringNamespace 
- The resource provider namespace of the resource to lock.
- ResourceType string
- The resource type of the resource to lock.
- LockName string
- The name of lock. 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
[]ManagementLock Owner Args 
- The owners of the lock.
- apiVersion String
- The API version to use for this operation.
- level
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.
- parentResource StringPath 
- The parent resource identity.
- resourceGroup StringName 
- The name of the resource group containing the resource to lock.
- resourceName String
- The name of the resource to lock.
- resourceProvider StringNamespace 
- The resource provider namespace of the resource to lock.
- resourceType String
- The resource type of the resource to lock.
- lockName String
- The name of lock. 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<ManagementLock Owner> 
- The owners of the lock.
- apiVersion string
- The API version to use for this operation.
- level
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.
- parentResource stringPath 
- The parent resource identity.
- resourceGroup stringName 
- The name of the resource group containing the resource to lock.
- resourceName string
- The name of the resource to lock.
- resourceProvider stringNamespace 
- The resource provider namespace of the resource to lock.
- resourceType string
- The resource type of the resource to lock.
- lockName string
- The name of lock. 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
ManagementLock Owner[] 
- The owners of the lock.
- api_version str
- The API version to use for this operation.
- level
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.
- parent_resource_ strpath 
- The parent resource identity.
- resource_group_ strname 
- The name of the resource group containing the resource to lock.
- resource_name str
- The name of the resource to lock.
- resource_provider_ strnamespace 
- The resource provider namespace of the resource to lock.
- resource_type str
- The resource type of the resource to lock.
- lock_name str
- The name of lock. 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[ManagementLock Owner Args] 
- The owners of the lock.
- apiVersion String
- The API version to use for this operation.
- level
String | "NotSpecified" | "Can Not Delete" | "Read Only" 
- 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.
- parentResource StringPath 
- The parent resource identity.
- resourceGroup StringName 
- The name of the resource group containing the resource to lock.
- resourceName String
- The name of the resource to lock.
- resourceProvider StringNamespace 
- The resource provider namespace of the resource to lock.
- resourceType String
- The resource type of the resource to lock.
- lockName String
- The name of lock. 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 ManagementLockAtResourceLevel resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the lock.
- SystemData Pulumi.Azure Native. Authorization. Outputs. System Data Response 
- Metadata pertaining to creation and last modification of the resource.
- Type string
- The resource type of the lock - Microsoft.Authorization/locks.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the lock.
- SystemData SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- Type string
- The resource type of the lock - Microsoft.Authorization/locks.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the lock.
- systemData SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- type String
- The resource type of the lock - Microsoft.Authorization/locks.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the lock.
- systemData SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- type string
- The resource type of the lock - Microsoft.Authorization/locks.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the lock.
- system_data SystemData Response 
- Metadata pertaining to creation and last modification of the resource.
- type str
- The resource type of the lock - Microsoft.Authorization/locks.
- 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
- CanNot Delete 
- CanNotDelete
- ReadOnly 
- ReadOnly
- LockLevel Not Specified 
- NotSpecified
- LockLevel Can Not Delete 
- CanNotDelete
- LockLevel Read Only 
- ReadOnly
- NotSpecified 
- NotSpecified
- CanNot Delete 
- CanNotDelete
- ReadOnly 
- ReadOnly
- NotSpecified 
- NotSpecified
- CanNot Delete 
- CanNotDelete
- ReadOnly 
- ReadOnly
- NOT_SPECIFIED
- NotSpecified
- CAN_NOT_DELETE
- CanNotDelete
- READ_ONLY
- ReadOnly
- "NotSpecified" 
- NotSpecified
- "CanNot Delete" 
- 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.
- CreatedBy stringType 
- The type of identity that created the resource.
- LastModified stringAt 
- The timestamp of resource last modification (UTC)
- LastModified stringBy 
- The identity that last modified the resource.
- LastModified stringBy Type 
- 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.
- CreatedBy stringType 
- The type of identity that created the resource.
- LastModified stringAt 
- The timestamp of resource last modification (UTC)
- LastModified stringBy 
- The identity that last modified the resource.
- LastModified stringBy Type 
- 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.
- createdBy StringType 
- The type of identity that created the resource.
- lastModified StringAt 
- The timestamp of resource last modification (UTC)
- lastModified StringBy 
- The identity that last modified the resource.
- lastModified StringBy Type 
- 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.
- createdBy stringType 
- The type of identity that created the resource.
- lastModified stringAt 
- The timestamp of resource last modification (UTC)
- lastModified stringBy 
- The identity that last modified the resource.
- lastModified stringBy Type 
- 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_ strtype 
- The type of identity that created the resource.
- last_modified_ strat 
- The timestamp of resource last modification (UTC)
- last_modified_ strby 
- The identity that last modified the resource.
- last_modified_ strby_ type 
- 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.
- createdBy StringType 
- The type of identity that created the resource.
- lastModified StringAt 
- The timestamp of resource last modification (UTC)
- lastModified StringBy 
- The identity that last modified the resource.
- lastModified StringBy Type 
- 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:ManagementLockAtResourceLevel testlock /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName} 
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0