Skip to content

Create Installs

Nuon offers multiple ways to create installs, allowing to implement and manage this important process in the way that best suits your business needs.

Installers

If you want to offer your customers a self-serve experience, you can create an installer. Installers bundle together all the config required to present a friendly UX your customers can use to install your app.

Reference the Installers guide to learn more.

CLI

Installs can be created via the Nuon CLI.

Terminal window
nuon installs create --name=auto-deploy --region=us-east-1 --role=iam-role

Terraform

Installs can be created and managed using Terraform.

Example of creating an install using Terraform:

resource "nuon_install" "install" {
app_id = nuon_app.<your-app>.id
name = "nuon-test-install"
aws {
region = "us-east-1"
iam_role_arn = var.install_role_arn
}
input {
name = "aws-eks-version"
value = "v.1.28"
}
}

API and SDKs

Installs can be created directly via our API, or by using an SDK:

An example of using nuon-go to create an install as part of a signup endpoint:

installs.go
type CreateInstallRequest struct {
Name string `json:"name" validate:"required"`
AWSAccount struct {
Region string `json:"region"`
IAMRoleARN string `json:"iam_role_arn" validate:"required"`
} `json:"aws_account" validate:"required"`
AppName string `json:"app_name" validate:"required"`
}
func (c *CreateInstallRequest) Validate(v *validator.Validate) error {
if err := v.Struct(c); err != nil {
return fmt.Errorf("invalid request: %w", err)
}
return nil
}
func (s *app) signup(ctx *gin.Context) {
var req CreateInstallRequest
if err := ctx.BindJSON(&req); err != nil {
ctx.Error(fmt.Errorf("unable to parse request: %w", err))
return
}
if err := req.Validate(s.v); err != nil {
writeErr(ctx, err)
return
}
app, err := s.apiClient.GetApp(ctx, req.AppName)
if err != nil {
writeErr(ctx, err)
return
}
install, err := s.apiClient.CreateInstall(ctx, app.ID, &models.ServiceCreateInstallRequest{
Name: &req.Name,
AwsAccount: &models.ServiceCreateInstallRequestAwsAccount{
IamRoleArn: &req.AWSAccount.IAMRoleARN,
Region: req.AWSAccount.Region,
},
})
if err != nil {
writeErr(ctx, err)
return
}
ctx.JSON(http.StatusCreated, install)
}