Newapp.io

Overview

The newapp.io domain is a convenience offering for users of the Humanitec Platform Orchestrator. That domain is managed by Humanitec. You may obtain DNS records and corresponding TLS/SSL certificates for a newapp.io subdomain named after your Humanitec Organization using the Drivers on this page. Using this offering is not recommended for production grade environments. It is intended to help you get started quickly without depending on domain name provisioning processes in your organization. The offering consists of two different Drivers:

  • newapp-io-dns that is responsible for generating DNS names under {yourOrgId}.newapp.io subdomain.
  • newapp-io-tls-cert that is responsible for generating a wildcard TLS certificate for *.{yourOrgId}.newapp.io.

newapp-io-dns

This Driver generates a new DNS record under the subdomain {yourOrgId}.newapp.io. See the Overview for more details on this domain.

This Driver is used by the dns Default Resource Definition.

Property Description
Resource type dns
Account type None

Inputs

Values

Name Type Description
template string [Optional] A Go Template which should render to a valid DNS subdomain Name.

Secrets

None

Notes

This Driver adds a DNS record under the {yourOrgId}.newapp.io at the Load Balancer for the relevant cluster as set by the loadbalancer property in the cluster resource.

If template is not specified, a random string made up of 3 domain words will be used as the subdomain.

This Driver can be used with environments running on different clusters.

Template

The template string is evaluated as a Go Template. The Sprig library of template functions is also available. Note that the template string does not need to include any Go template structures. For example, the context placeholders can be used on their own to create friendly subdomains:

${context.env.id}-${context.app.id}

will generate a subdomain made up of the Environment ID and the Application ID under {yourOrgId}.newapp.io.

Example

Use the humanitec/newapp-io-dns Driver to provision a new name under {myOrgId}.newapp.io for an app called newapp-io-dns-example-app.

The following dynamic Resource Definition should be added. Apply the following modifications as needed:

  • Adjust the criteria to the Matching Criteria to fit your setup.
  • Decide whether you need to co-provision an ingress resource as shown, and remove the provision section if not. See Routes for a discussion on how the networking Resource Types work together.

cat <<EOF > dynamic-dns-newapp-io.yaml
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: dynamic-dns-newapp-io
entity:
  driver_type: humanitec/newapp-io-dns
  name: "Dynamic DNS name under newapp.io"
  type: dns
  driver_inputs:
    values:
      template: \${context.env.id}-\${context.app.id}  
  criteria:
    - app_id: newapp-io-dns-example-app
  provision:
    ingress:
      is_dependent: false
EOF

humctl create -f dynamic-dns-newapp-io.yaml

curl https://api.humanitec.io/orgs/my-org/resources/defs \
  -X POST \
  -H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
  -H "Content-Type: application/json" \
  --data-binary '{
  "id": "dynamic-dns-newapp-io",
  "name": "Dynamic DNS name under newapp.io",
  "type": "dns",
  "driver_type": "humanitec/newapp-io-dns",
  "driver_inputs": {
    "values": {
      "template": "${context.env.id}-${context.app.id}"
    }  
  },
  "criteria": [
    {
      "app_id": "newapp-io-dns-example-app"
    }
  ],
  "provision": {
    "ingress": {
      "is_dependent": false
    }
  }
}'

Use this Resource Definition for the Humanitec Terraform Provider:

resource "humanitec_resource_definition" "dns-newapp-io" {
  id             = "dynamic-dns-newapp-io"
  name           = "Dynamic DNS name under newapp.io"
  type           = "dns"
  driver_type    = "humanitec/newapp-io-dns"
  
  driver_inputs = {
    values_string = jsonencode({
      "template" = "$${context.env.id}-$${context.app.id}"
    })
  }  

  provision = {
    ingress = {
      is_dependent = false
    }
  }
}

resource "humanitec_resource_definition_criteria" "dns-newapp-io" {
  resource_definition_id = humanitec_resource_definition.dns-newapp-io.id
  app_id                 = "newapp-io-dns-example-app"
}

newapp-io-tls

This Driver generates a wildcard TLS certificate for *.{yourOrgId}.newapp.io. See the Overview for more details on this domain.

This Driver is used by the tls-cert Default Resource Definition.

Property Description
Resource type tls-cert
Account type None

Inputs

Values

None

Secrets

None

Example

Use the humanitec/newapp-io-tls Driver to provision a wildcard TLS certificate for *.{yourOrgId}.newapp.io for an app called newapp-io-dns-example-app.

The following dynamic Resource Definition should be added. Apply the following modifications as needed:

cat <<EOF > dynamic-tls-cert-newapp-io.yaml
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: dynamic-tls-cert-newapp-io
entity:
  driver_type: humanitec/newapp-io-tls
  name: "Dynamic wildcard DNS for organization newapp.io subdomain"
  type: tls-cert
  criteria:
    - app_id: newapp-io-dns-example-app
EOF

humctl create -f dynamic-tls-cert-newapp-io.yaml

curl https://api.humanitec.io/orgs/my-org/resources/defs \
  -X POST \
  -H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
  -H "Content-Type: application/json" \
  --data-binary '{
  "id": "dynamic-tls-cert-newapp-io",
  "name": "Dynamic wildcard DNS for organization newapp.io subdomain",
  "type": "tls-cert",
  "driver_type": "humanitec/newapp-io-tls",
  "criteria": [
    {
      "app_id": "newapp-io-dns-example-app"
    }
  ]
}'

Use this Resource Definition for the Humanitec Terraform Provider:

resource "humanitec_resource_definition" "tls-cert-newapp-io" {
  id             = "dynamic-tls-cert-newapp-io"
  name           = "Dynamic wildcard DNS for organization newapp.io subdomain"
  type           = "tls-cert"
  driver_type    = "humanitec/newapp-io-tls"
}

resource "humanitec_resource_definition_criteria" "tls-cert-newapp-io" {
  resource_definition_id = humanitec_resource_definition.tls-cert-newapp-io.id
  app_id                 = "newapp-io-dns-example-app"
}
Top