1. Packages
  2. Linode Provider
  3. API Docs
  4. getLock
Linode v5.6.0 published on Wednesday, Dec 24, 2025 by Pulumi
linode logo
Linode v5.6.0 published on Wednesday, Dec 24, 2025 by Pulumi

    Early Access: Lock functionality is in early access and may not be available to all users.

    Important Only unrestricted users can view locks. Restricted users cannot access lock information even if they have permissions for the resource.

    Provides information about a Linode Lock. Locks prevent accidental deletion, rebuild operations, and service transfers of resources.

    For more information, see the Linode APIv4 docs (TBD).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const myLock = linode.getLock({
        id: 123456,
    });
    
    import pulumi
    import pulumi_linode as linode
    
    my_lock = linode.get_lock(id=123456)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v5/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := linode.LookupLock(ctx, &linode.LookupLockArgs{
    			Id: 123456,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var myLock = Linode.GetLock.Invoke(new()
        {
            Id = 123456,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetLockArgs;
    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 myLock = LinodeFunctions.getLock(GetLockArgs.builder()
                .id(123456)
                .build());
    
        }
    }
    
    variables:
      myLock:
        fn::invoke:
          function: linode:getLock
          arguments:
            id: 123456
    

    Using getLock

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getLock(args: GetLockArgs, opts?: InvokeOptions): Promise<GetLockResult>
    function getLockOutput(args: GetLockOutputArgs, opts?: InvokeOptions): Output<GetLockResult>
    def get_lock(id: Optional[int] = None,
                 opts: Optional[InvokeOptions] = None) -> GetLockResult
    def get_lock_output(id: Optional[pulumi.Input[int]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetLockResult]
    func LookupLock(ctx *Context, args *LookupLockArgs, opts ...InvokeOption) (*LookupLockResult, error)
    func LookupLockOutput(ctx *Context, args *LookupLockOutputArgs, opts ...InvokeOption) LookupLockResultOutput

    > Note: This function is named LookupLock in the Go SDK.

    public static class GetLock 
    {
        public static Task<GetLockResult> InvokeAsync(GetLockArgs args, InvokeOptions? opts = null)
        public static Output<GetLockResult> Invoke(GetLockInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLockResult> getLock(GetLockArgs args, InvokeOptions options)
    public static Output<GetLockResult> getLock(GetLockArgs args, InvokeOptions options)
    
    fn::invoke:
      function: linode:index/getLock:getLock
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id int
    The unique ID of the Lock.
    Id int
    The unique ID of the Lock.
    id Integer
    The unique ID of the Lock.
    id number
    The unique ID of the Lock.
    id int
    The unique ID of the Lock.
    id Number
    The unique ID of the Lock.

    getLock Result

    The following output properties are available:

    EntityId int
    The ID of the locked entity.
    EntityLabel string
    The label of the locked entity.
    EntityType string
    The type of the locked entity.
    EntityUrl string
    The URL of the locked entity.
    Id int
    LockType string
    The type of lock.
    EntityId int
    The ID of the locked entity.
    EntityLabel string
    The label of the locked entity.
    EntityType string
    The type of the locked entity.
    EntityUrl string
    The URL of the locked entity.
    Id int
    LockType string
    The type of lock.
    entityId Integer
    The ID of the locked entity.
    entityLabel String
    The label of the locked entity.
    entityType String
    The type of the locked entity.
    entityUrl String
    The URL of the locked entity.
    id Integer
    lockType String
    The type of lock.
    entityId number
    The ID of the locked entity.
    entityLabel string
    The label of the locked entity.
    entityType string
    The type of the locked entity.
    entityUrl string
    The URL of the locked entity.
    id number
    lockType string
    The type of lock.
    entity_id int
    The ID of the locked entity.
    entity_label str
    The label of the locked entity.
    entity_type str
    The type of the locked entity.
    entity_url str
    The URL of the locked entity.
    id int
    lock_type str
    The type of lock.
    entityId Number
    The ID of the locked entity.
    entityLabel String
    The label of the locked entity.
    entityType String
    The type of the locked entity.
    entityUrl String
    The URL of the locked entity.
    id Number
    lockType String
    The type of lock.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v5.6.0 published on Wednesday, Dec 24, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate