Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Terraform course

        Child module inputs

        Opening Terraform
        Your turn

        Terraform modules: inputs, outputs and versions

        A module interface

        A child module receives input variables and exposes output values. It doesn’t automatically inherit variables from the calling module. Pass each required value and check the declared type.

        module "dispatch" {
          source = "./modules/service"
          name   = "cedar-dispatch"
          region = "north"
        }
        
        output "dispatch_id" {
          value = module.dispatch.id
        }

        This original example assumes that the local module declares name and region inputs and an id output. A different module needs its own interface. File paths and provider schemas in the browser model are teaching contracts.

        Version and identity boundaries

        A local module path identifies code in the working tree. Registry modules support a version constraint; a Git source uses its supported source-reference syntax. The provider lockfile records provider selections, not a lock of all module source code.

        Renaming a module call also changes addresses below it. Review the moved-block exercises before a refactor so that a new address doesn’t accidentally become a destroy-and-create plan. The HashiCorp module reference explains the full language model.

        Continue with module outputs and module version constraints.

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.