1. Packages
  2. Formal Provider
  3. API Docs
  4. getResource
Formal v1.1.0 published on Sunday, Mar 1, 2026 by Formal
formal logo
Formal v1.1.0 published on Sunday, Mar 1, 2026 by Formal

    Data source for looking up a Resource by ID or by name. Use either id or name, but not both.

    Using getResource

    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 getResource(args: GetResourceArgs, opts?: InvokeOptions): Promise<GetResourceResult>
    function getResourceOutput(args: GetResourceOutputArgs, opts?: InvokeOptions): Output<GetResourceResult>
    def get_resource(id: Optional[str] = None,
                     name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetResourceResult
    def get_resource_output(id: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetResourceResult]
    func LookupResource(ctx *Context, args *LookupResourceArgs, opts ...InvokeOption) (*LookupResourceResult, error)
    func LookupResourceOutput(ctx *Context, args *LookupResourceOutputArgs, opts ...InvokeOption) LookupResourceResultOutput

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

    public static class GetResource 
    {
        public static Task<GetResourceResult> InvokeAsync(GetResourceArgs args, InvokeOptions? opts = null)
        public static Output<GetResourceResult> Invoke(GetResourceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourceResult> getResource(GetResourceArgs args, InvokeOptions options)
    public static Output<GetResourceResult> getResource(GetResourceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: formal:index/getResource:getResource
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of this Resource.
    Name string
    The name of the Resource to look up. Use this to fetch a resource by name.
    Id string
    The ID of this Resource.
    Name string
    The name of the Resource to look up. Use this to fetch a resource by name.
    id String
    The ID of this Resource.
    name String
    The name of the Resource to look up. Use this to fetch a resource by name.
    id string
    The ID of this Resource.
    name string
    The name of the Resource to look up. Use this to fetch a resource by name.
    id str
    The ID of this Resource.
    name str
    The name of the Resource to look up. Use this to fetch a resource by name.
    id String
    The ID of this Resource.
    name String
    The name of the Resource to look up. Use this to fetch a resource by name.

    getResource Result

    The following output properties are available:

    CreatedAt int
    Creation time of the Resource.
    Environment string
    Environment for the Resource.
    Hostname string
    Hostname of the Resource.
    Port int
    The port your Resource is listening on.
    SpaceId string
    The ID of the Space the Resource is in.
    Technology string
    Technology of the Resource.
    TerminationProtection bool
    If set to true, the Resource cannot be deleted.
    Id string
    The ID of this Resource.
    Name string
    The name of the Resource to look up. Use this to fetch a resource by name.
    CreatedAt int
    Creation time of the Resource.
    Environment string
    Environment for the Resource.
    Hostname string
    Hostname of the Resource.
    Port int
    The port your Resource is listening on.
    SpaceId string
    The ID of the Space the Resource is in.
    Technology string
    Technology of the Resource.
    TerminationProtection bool
    If set to true, the Resource cannot be deleted.
    Id string
    The ID of this Resource.
    Name string
    The name of the Resource to look up. Use this to fetch a resource by name.
    createdAt Integer
    Creation time of the Resource.
    environment String
    Environment for the Resource.
    hostname String
    Hostname of the Resource.
    port Integer
    The port your Resource is listening on.
    spaceId String
    The ID of the Space the Resource is in.
    technology String
    Technology of the Resource.
    terminationProtection Boolean
    If set to true, the Resource cannot be deleted.
    id String
    The ID of this Resource.
    name String
    The name of the Resource to look up. Use this to fetch a resource by name.
    createdAt number
    Creation time of the Resource.
    environment string
    Environment for the Resource.
    hostname string
    Hostname of the Resource.
    port number
    The port your Resource is listening on.
    spaceId string
    The ID of the Space the Resource is in.
    technology string
    Technology of the Resource.
    terminationProtection boolean
    If set to true, the Resource cannot be deleted.
    id string
    The ID of this Resource.
    name string
    The name of the Resource to look up. Use this to fetch a resource by name.
    created_at int
    Creation time of the Resource.
    environment str
    Environment for the Resource.
    hostname str
    Hostname of the Resource.
    port int
    The port your Resource is listening on.
    space_id str
    The ID of the Space the Resource is in.
    technology str
    Technology of the Resource.
    termination_protection bool
    If set to true, the Resource cannot be deleted.
    id str
    The ID of this Resource.
    name str
    The name of the Resource to look up. Use this to fetch a resource by name.
    createdAt Number
    Creation time of the Resource.
    environment String
    Environment for the Resource.
    hostname String
    Hostname of the Resource.
    port Number
    The port your Resource is listening on.
    spaceId String
    The ID of the Space the Resource is in.
    technology String
    Technology of the Resource.
    terminationProtection Boolean
    If set to true, the Resource cannot be deleted.
    id String
    The ID of this Resource.
    name String
    The name of the Resource to look up. Use this to fetch a resource by name.

    Package Details

    Repository
    formal formalco/pulumi-formal
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the formal Terraform Provider.
    formal logo
    Formal v1.1.0 published on Sunday, Mar 1, 2026 by Formal
      Meet Neo: Your AI Platform Teammate