What is a Sandbox?
Sandboxes create a consistent, isolated environment that your application can be guaranteed to work with, across your App Installs different installs. They are responsible for defining the basic networking, permissioning, and infrastructure compute primitives e.g., a Kubernetes cluster - to power the App. In a shared responsiblity model, a customer may provide some infrastructure in the Sandbox, such as an existing VPC or Kubernetes cluster. In this case, Sandboxes enable you to leverage this customer infrastructure to meet security requirements, while also having a consistent way to deploy and manage your App in any account. Sandboxes can ensure isolation, reproducability and repeatability with each install - regardless of the account.How is a Sandbox configured?
A Sandbox is configured in asandbox.toml
file inside the root of your App
Config directory. To configure a Sandbox, specify a repo and the correct
parameters for your Sandbox.
Inputs and variables, are entered both inline in the sandbox.toml
and also the
tfvars
file - to configure the Sandbox, and these are passed to the Terraform
code that is run by the Sandbox.
You can configure Sandboxes to use either a public repo (using a public_repo
block) such as Nuon’s public repository of AWS and Azure sandboxes - or a
private GitHub repo (using a connected_repo
block). Read more about VCS
configuration here.
sandbox.toml
sandbox.tfvars
Nuon Managed Sandboxes
We maintain managed Sandboxes for each platform that we support. Each platform has a turnkey sandbox (where all resources are provisioned). These sandboxes are designed to be a stable, configurable starting point and most relevant options around the network, cluster and compute are configurable.Let us know if you have a use case for bringing
your own VPC or Kubernetes cluster, and we can show how to adjust the sandbox
configuration.
sandbox.toml
.
AWS EKS Sandbox
AWS EKS with Karpenter Sandbox
AWS Min Sandbox
Azure AKS Sandbox
The AWS Min Sandbox does not create a Kubernetes cluster, but still provisions
a Route 53 Zone and IAM roles for the install. See the Lambda function
example that leverages the AWS Min Sandbox.
Runner Types
Update therunner.toml
in your App Config to specify the type of Cloud runner
to use for your App. The runner is responsible for executing the deployment of
your App into the customer’s account.
runner.toml
runner.toml
Sandbox Outputs
Sandbox outputs are made accessible to all components using variables. You can use any output from your selected Sandbox by setting a config value on your component. In this example, we are using theaccount.region
output from
the Sandbox to configure a Helm chart component:
components/e2e_helm.toml
account.id
- The AWS Account IDaccount.region
- The AWS Regionvpc.id
- The VPC IDcluster.cluster_name
- The EKS Cluster namecluster.cluster_endpoint
- The EKS Cluster endpointecr.repository_url
- The ECR repository URLecr.registry_url
- The ECR registry URLnuon_dns.public_domain
- The public root domain for the installnuon_dns.internal_domain
- The internal root domain for the installnamespaces
- A list of namespaces created in the cluster
Configure Sandboxes
Each Sandbox has a set of variable inputs. Most variables are either supplied by the Nuon platform during install, via Inputs, or by setting default values.Use Default Values
To configure a Sandbox parameter with a default value for your App, add avars
block to your sandbox.toml
file, or the mandatory sandbox.tfvars
file in the
same directory as your sandbox.toml
. The values in this block will be used as
defaults for all installs of this App.:
sandbox.toml
sandbox.tfvars
Use Inputs
Inputs allow you to collect customer input in the dashboard at App Install for values such as resource IDs, tokens and more. These Inputs are accesible to all Components and your Sandbox, using variables. To configure a Sandbox parameter using an Input, you can define an Input in yourinputs.toml
file and then reference it in your sandbox.toml
file. In this
example, we define a root domain Input and use it to set the
public_root_domain
variable in the Sandbox:
inputs.toml
sandbox.toml
Create a Custom Sandbox
While our open source Sandboxes are a great starting point, you can always fork them, or create your own Sandbox to support customizing. To use a custom Sandbox, simply update your App Config’ssandbox.toml
to point
to your new Sandbox code. Custom Sandboxes can also use private GitHub repos,
that are connected to Nuon.
sandbox.toml
If one of our managed Sandboxes does not work for you, and you are considering creating a custom Sandbox, we would love to hear about your use case. Please get in touch.