1. Packages
  2. Azure Native v1
  3. API Docs
  4. authorization
  5. ManagementLockByScope
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.authorization.ManagementLockByScope

Explore with Pulumi AI

azure-native-v1 logo
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

    The lock information. 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 = "ReadOnly",
            LockName = "testlock",
            Scope = "subscriptions/subscriptionId",
        });
    
    });
    
    package main
    
    import (
    	authorization "github.com/pulumi/pulumi-azure-native-sdk/authorization"
    	"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("ReadOnly"),
    			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 pulumi
    import pulumi_azure_native as azure_native
    
    management_lock_by_scope = azure_native.authorization.ManagementLockByScope("managementLockByScope",
        level="ReadOnly",
        lock_name="testlock",
        scope="subscriptions/subscriptionId")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const managementLockByScope = new azure_native.authorization.ManagementLockByScope("managementLockByScope", {
        level: "ReadOnly",
        lockName: "testlock",
        scope: "subscriptions/subscriptionId",
    });
    
    resources:
      managementLockByScope:
        type: azure-native:authorization:ManagementLockByScope
        properties:
          level: ReadOnly
          lockName: testlock
          scope: subscriptions/subscriptionId
    

    Create ManagementLockByScope Resource

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

    Constructor syntax

    new ManagementLockByScope(name: string, args: ManagementLockByScopeArgs, opts?: CustomResourceOptions);
    @overload
    def ManagementLockByScope(resource_name: str,
                              args: ManagementLockByScopeArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ManagementLockByScope(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              level: Optional[Union[str, LockLevel]] = None,
                              scope: Optional[str] = None,
                              lock_name: Optional[str] = None,
                              notes: Optional[str] = None,
                              owners: Optional[Sequence[ManagementLockOwnerArgs]] = None)
    func NewManagementLockByScope(ctx *Context, name string, args ManagementLockByScopeArgs, opts ...ResourceOption) (*ManagementLockByScope, error)
    public ManagementLockByScope(string name, ManagementLockByScopeArgs args, CustomResourceOptions? opts = null)
    public ManagementLockByScope(String name, ManagementLockByScopeArgs args)
    public ManagementLockByScope(String name, ManagementLockByScopeArgs args, CustomResourceOptions options)
    
    type: azure-native:authorization:ManagementLockByScope
    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 ManagementLockByScopeArgs
    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 ManagementLockByScopeArgs
    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 ManagementLockByScopeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ManagementLockByScopeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ManagementLockByScopeArgs
    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 managementLockByScopeResource = new AzureNative.Authorization.ManagementLockByScope("managementLockByScopeResource", new()
    {
        Level = "string",
        Scope = "string",
        LockName = "string",
        Notes = "string",
        Owners = new[]
        {
            
            {
                { "applicationId", "string" },
            },
        },
    });
    
    example, err := authorization.NewManagementLockByScope(ctx, "managementLockByScopeResource", &authorization.ManagementLockByScopeArgs{
    	Level:    "string",
    	Scope:    "string",
    	LockName: "string",
    	Notes:    "string",
    	Owners: []map[string]interface{}{
    		map[string]interface{}{
    			"applicationId": "string",
    		},
    	},
    })
    
    var managementLockByScopeResource = new ManagementLockByScope("managementLockByScopeResource", ManagementLockByScopeArgs.builder()
        .level("string")
        .scope("string")
        .lockName("string")
        .notes("string")
        .owners(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
        .build());
    
    management_lock_by_scope_resource = azure_native.authorization.ManagementLockByScope("managementLockByScopeResource",
        level=string,
        scope=string,
        lock_name=string,
        notes=string,
        owners=[{
            applicationId: string,
        }])
    
    const managementLockByScopeResource = new azure_native.authorization.ManagementLockByScope("managementLockByScopeResource", {
        level: "string",
        scope: "string",
        lockName: "string",
        notes: "string",
        owners: [{
            applicationId: "string",
        }],
    });
    
    type: azure-native:authorization:ManagementLockByScope
    properties:
        level: string
        lockName: string
        notes: string
        owners:
            - applicationId: string
        scope: string
    

    ManagementLockByScope Resource Properties

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

    Inputs

    The ManagementLockByScope resource accepts the following input properties:

    Level 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.
    Scope string
    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.
    LockName string
    The name of lock.
    Notes string
    Notes about the lock. Maximum of 512 characters.
    Owners List<Pulumi.AzureNative.Authorization.Inputs.ManagementLockOwner>
    The owners of the lock.
    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.
    Scope string
    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.
    LockName string
    The name of lock.
    Notes string
    Notes about the lock. Maximum of 512 characters.
    Owners []ManagementLockOwnerArgs
    The owners of the lock.
    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.
    scope String
    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.
    lockName String
    The name of lock.
    notes String
    Notes about the lock. Maximum of 512 characters.
    owners List<ManagementLockOwner>
    The owners of the lock.
    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.
    scope string
    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.
    lockName string
    The name of lock.
    notes string
    Notes about the lock. Maximum of 512 characters.
    owners ManagementLockOwner[]
    The owners of the lock.
    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.
    scope str
    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.
    lock_name str
    The name of lock.
    notes str
    Notes about the lock. Maximum of 512 characters.
    owners Sequence[ManagementLockOwnerArgs]
    The owners of the lock.
    level 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.
    scope String
    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.
    lockName String
    The name of lock.
    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 ManagementLockByScope resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the lock.
    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.
    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.
    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.
    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.
    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.
    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.

    Import

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

    $ pulumi import azure-native:authorization:ManagementLockByScope testlock /subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock 
    

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

    Package Details

    Repository
    azure-native-v1 pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native-v1 logo
    These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
    Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi