Nuon installs can be created in one of the following ways.

This guide assumes that you have create an IAM role, granting Nuon access to provision an AWS install. If not, please follow this guide first.

Installers

Installers are generated web pages that can be used to create app installs. Installers can be generated using Terraform.

To create an installer using terraform:

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

  name = "Your App Name"
  description = "Your App Name Installer"
  slug = "your-app"

  documentation_url = "https://docs.nuon.co"
  community_url = "https://join.slack.com/t/nuoncommunity/shared_invite/zt-1q323vw9z-C8ztRP~HfWjZx6AXi50VRA"
  homepage_url = "https://nuon.co"
  github_url = "https://github.com/nuonco"
  logo_url = "https://fakeimg.pl/250x100/"
  demo_url = "https://www.loom.com/share/aec62b468f9747c59ed5c30c79d473c4"
}

Once an installer is created, it can be accessed at <slug>.app.nuon.co. The installer provides an automated way to create an install.

CLI

Installs can be created via the Nuon CLI.

To create an install:

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

Terraform

Installs can be created and managed using Terraform.

Example of creating an install using Terraform:

resource "nuon_install" "install" {
  app_id = nuon_app.main.id

  name         = "nuon-test-install"
  region       = "us-east-1"
  iam_role_arn = var.install_role_arn

  input {
    name = "aws-eks-version"
    value = "v.1.28"
  }
}

Please refer to the Terraform configuration management guide for more details on working with the terraform provider.

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:

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)
}