1. Packages
  2. Packages
  3. Any HCL Module
  4. API Docs
  5. Module
Viewing docs for Any HCL Module 0.9.1
published on Tuesday, Jul 7, 2026 by Pulumi
Viewing docs for Any HCL Module 0.9.1
published on Tuesday, Jul 7, 2026 by Pulumi

    A Terraform/OpenTofu module instantiated as a component resource.

    Create Module Resource

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

    Constructor syntax

    new Module(name: string, args: ModuleArgs, opts?: ComponentResourceOptions);
    @overload
    def Module(resource_name: str,
               args: ModuleArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Module(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               source: Optional[str] = None,
               inputs: Optional[Mapping[str, Any]] = None,
               version: Optional[str] = None)
    func NewModule(ctx *Context, name string, args ModuleArgs, opts ...ResourceOption) (*Module, error)
    public Module(string name, ModuleArgs args, ComponentResourceOptions? opts = null)
    public Module(String name, ModuleArgs args)
    public Module(String name, ModuleArgs args, ComponentResourceOptions options)
    
    type: hcl:Module
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "hcl_module" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ModuleArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ModuleArgs
    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 ModuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ModuleArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ModuleArgs
    The arguments to resource properties.
    options ComponentResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var moduleResource = new Hcl.Module("moduleResource", new()
    {
        Source = "string",
        Inputs = 
        {
            { "string", "any" },
        },
        Version = "string",
    });
    
    example, err := hcl.NewModule(ctx, "moduleResource", &hcl.ModuleArgs{
    	Source: "string",
    	Inputs: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	Version: "string",
    })
    
    resource "hcl_module" "moduleResource" {
      source = "string"
      inputs = {
        "string" = "any"
      }
      version = "string"
    }
    
    var moduleResource = new Module("moduleResource", ModuleArgs.builder()
        .source("string")
        .inputs(Map.of("string", "any"))
        .version("string")
        .build());
    
    module_resource = hcl.Module("moduleResource",
        source="string",
        inputs={
            "string": "any",
        },
        version="string")
    
    const moduleResource = new hcl.Module("moduleResource", {
        source: "string",
        inputs: {
            string: "any",
        },
        version: "string",
    });
    
    type: hcl:Module
    properties:
        inputs:
            string: any
        source: string
        version: string
    

    Module 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 Module resource accepts the following input properties:

    Source string
    The module source address (a registry reference, URL, or local path).
    Inputs Dictionary<string, object>
    The module's input variables, keyed by variable name.
    Version string
    An optional version constraint, used when source is a registry module reference.
    Source string
    The module source address (a registry reference, URL, or local path).
    Inputs map[string]interface{}
    The module's input variables, keyed by variable name.
    Version string
    An optional version constraint, used when source is a registry module reference.
    source string
    The module source address (a registry reference, URL, or local path).
    inputs map(any)
    The module's input variables, keyed by variable name.
    version string
    An optional version constraint, used when source is a registry module reference.
    source String
    The module source address (a registry reference, URL, or local path).
    inputs Map<String,Object>
    The module's input variables, keyed by variable name.
    version String
    An optional version constraint, used when source is a registry module reference.
    source string
    The module source address (a registry reference, URL, or local path).
    inputs {[key: string]: any}
    The module's input variables, keyed by variable name.
    version string
    An optional version constraint, used when source is a registry module reference.
    source str
    The module source address (a registry reference, URL, or local path).
    inputs Mapping[str, Any]
    The module's input variables, keyed by variable name.
    version str
    An optional version constraint, used when source is a registry module reference.
    source String
    The module source address (a registry reference, URL, or local path).
    inputs Map<Any>
    The module's input variables, keyed by variable name.
    version String
    An optional version constraint, used when source is a registry module reference.

    Outputs

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

    Outputs Dictionary<string, object>
    The module's output values, keyed by output name.
    Outputs map[string]interface{}
    The module's output values, keyed by output name.
    outputs map(any)
    The module's output values, keyed by output name.
    outputs Map<String,Object>
    The module's output values, keyed by output name.
    outputs {[key: string]: any}
    The module's output values, keyed by output name.
    outputs Mapping[str, Any]
    The module's output values, keyed by output name.
    outputs Map<Any>
    The module's output values, keyed by output name.

    Package Details

    Repository
    hcl pulumi-labs/pulumi-hcl
    License
    Apache-2.0
    Viewing docs for Any HCL Module 0.9.1
    published on Tuesday, Jul 7, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial