Skip to content

Latest commit

 

History

History

scaffolder-backend-module-noderings

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

@noderings/backstage-plugin-scaffolder-backend-module-noderings

Scaffolder actions for NodeRings: order and delete servers and write DNS records from Backstage Software Templates.

Action Registered Notes
noderings:vm:create unless noderings.scaffolder.allowCreate: false Orders a billed server.
noderings:vm:delete only with noderings.scaffolder.allowDelete: true Permanent. Only servers with a backstage- tag.
noderings:dns:record:upsert always A, AAAA, CNAME, MX, TXT

All three support dry run. See /create/actions in your Backstage for the full input schemas and examples.

Full guide: https://docs.noderings.com/docs/client-guides/backstage

Install

yarn --cwd packages/backend add @noderings/backstage-plugin-scaffolder-backend-module-noderings
// packages/backend/src/index.ts
backend.add(
  import('@noderings/backstage-plugin-scaffolder-backend-module-noderings'),
);

Configure

noderings:
  token: ${NODERINGS_TOKEN}
  scaffolder:
    allowCreate: true
    allowDelete: false
    allowedPlanIds: [] # empty = any plan
    allowedRegionIds: [] # empty = any region
    maxVmsPerTask: 1

noderings:vm:create

Input: hostname (RFC 1123 label), planId, regionId, distro (for example DISTRO_UBUNTU_24_04), sshKeyIds (at least one), tags, entityRef, waitForStart (default true), waitTimeoutMinutes (default 15, max 30). Output: vmId, hostname, ipv4, ipv6, status, tag.

  • The server is billed from the moment it is created. Usage-billed (hourly) plans need prepaid credit; the API error states the minimum when it is too low.
  • An idempotency key is stored in a task checkpoint before the order is sent, and the result in a second checkpoint, so a retried task never orders a second server.
  • With entityRef, the server gets the tag backstage-<namespace>-<kind>-<name> (lowercase, at most 63 characters); put it in the new entity's noderings.com/vm-tag annotation.
  • Dry run validates the input and the allowlists, reads the plan, and orders nothing.
  • There is no password or user-data input: access is by SSH key.
steps:
  - id: create-vm
    action: noderings:vm:create
    input:
      hostname: ${{ parameters.hostname }}
      planId: ${{ parameters.planId }}
      regionId: ${{ parameters.regionId }}
      distro: DISTRO_UBUNTU_24_04
      sshKeyIds: ['${{ parameters.sshKeyId }}']
      entityRef: resource:default/${{ parameters.hostname }}

noderings:vm:delete

Input: vmId, confirmHostname. Refuses unless the hostname matches and the server has a backstage- tag. Deleting is permanent: the server's snapshots and backups are deleted and its addresses released; if it was the last server on its subscription, the subscription is cancelled with a final usage charge.

noderings:dns:record:upsert

Input: zoneId, name, type, ttl (default 300), values, allowOverwrite (default false). Refuses to replace an existing, different record set with the same name and type unless allowOverwrite is true; does nothing when the record set already has these values.

name is relative to the zone (www, @ for the apex) or fully qualified (www.example.com, with or without the final dot); output name is the zone-relative name. Values are compared the way the API stores them, so hello matches the stored TXT value "hello" and target.example.com matches target.example.com..

License: Apache-2.0. Source: https://github.com/noderings/backstage-plugins.