Inputs are used to collect customer provider values, for configuring your app. Please refer to the Terraform reference for full configuration options.

Defining App Inputs

You can define app inputs using Terraform:

resource "nuon_app_input" "main" {
  app_id = nuon_app.main.id

  input {
    name        = input.value.name
    description = input.value.description
    default     = input.value.default
    required    = input.value.required
  }
}

Whenever an install is created, the Nuon platform will ensure that all inputs are properly configured:

$ nuon installs create --name=auto-deploy --region=us-east-1 --role=iam-role --inputs=eks_version=1.28

Configuration Using App Inputs

App inputs can be used to configure both sandboxes and components. All inputs are made available via variable configuration.

All inputs are accessed using {{.nuon.install.inputs.<input-name>}}.

Configuring Sandboxes

You can configure sandboxes by using install inputs as vars.

For example, to use the vpc_id input, as a variable to configure the aws-eks-byovpc sandbox:

resource "nuon_app_sandbox" "main" {
  app_id            = nuon_app.main.id
  terraform_version = "v1.6.3"

  public_repo = {
    repo      = "nuonco/sandboxes"
    branch    = "main"
    directory = "aws-eks-byovpc"
  }

  var {
    name = "vpc_id"
    value = "{{.nuon.install.inputs.vpc_id}}"
  }
}

Configuring Components

Depending upon the component type, you can use install inputs to configure components using Helm values, Terraform variables or environment variables.

To use inputs from a component:

resource "nuon_terraform_module_component" "database" {
  name   = "database"
  app_id = nuon_app.main.id
  terraform_version = "1.6.3"

  connected_repo = {
    directory = "terraform"
    repo      = "your-org/your-repo"
    branch    = "main"
  }

  env_var {
    name  = "DATABASE_PASSWORD"
    value = "{{.nuon.install.inputs.database_password}}"
  }

  var {
    name  = "DATABASE_HOST"
    value = "{{.nuon.install.inputs.database_password}}"
  }
}

App Inputs For Customer Resources

App inputs are commonly used to allow a customer to provide access to existing resources. For example, an input can be used for:

  • accepting a database url, or database ID to connect to
  • accepting a VPC ID to install an app into
  • accepting a token to access a third party cloud provider or account

The nuon managed sandboxes offer “bring-your-own-vpc” options, where inputs are used to accept the ID of a customer managed VPC for installation.

You can even use app inputs to manage resources from third party cloud providers.

Updating Inputs

If you add a required input after an install is created, the inputs must be added to the install before it can process any new sandbox updates or component provision/deprovision jobs.

Currently, updating inputs is only supported via our api.

We recommend avoiding adding backwards incompatible input changes in the same app.