Amplication Service Scaffold

Action ID: amplication:scaffold-service
NPM Package:

@backstage-community/plugin-scaffolder-backend-module-amplication

Description

Scaffold a new service from a template (using Amplication)

Input Schema

PropertyTypeDescriptionRequired
namestringThe name of the service
project_idstringThe ID of the project
descriptionstringThe description of the service
workspace_idstringThe ID of the workspace
serviceTemplate_idstringThe ID of the service template

Output Schema

No output schema defined for this action.

Usage Examples

Scaffold a basic service in an existing Amplication project

Adds a new service to an existing Amplication project using a selected service template. Use this when you want to bootstrap a service and then push a starter repo using fetch:template and publish:github.

Copy
steps:
  - id: fetch-base
    action: fetch:template
    input:
      url: ./skeletons/service
      targetPath: ./
      values:
        name: ${{ parameters.serviceName }}
        description: ${{ parameters.serviceDescription }}

  - id: scaffold-amplication-service
    action: amplication:scaffold-service
    input:
      name: ${{ parameters.serviceName }}
      description: ${{ parameters.serviceDescription }}
      project_id: ${{ parameters.amplicationProjectId }}
      serviceTemplate_id: ${{ parameters.amplicationServiceTemplateId }}

  - id: publish-repo
    action: publish:github
    input:
      repoUrl: github.com?owner=acme-inc&repo=${{ parameters.serviceName }}
      defaultBranch: main
      repoVisibility: private
      description: ${{ parameters.serviceDescription }}

Scaffold into a specific workspace

Creates a service in a specific Amplication workspace and project. Use this when your organization separates environments or teams by workspace and you need to control placement.

Copy
steps:
  - id: scaffold-amplication-service
    action: amplication:scaffold-service
    input:
      name: ${{ parameters.serviceName }}
      description: Service for order processing API
      project_id: ${{ parameters.amplicationProjectId }}
      serviceTemplate_id: 9e8c6a44-1d0f-4e4b-9f56-3ecbfb9e2f12
      workspace_id: ${{ parameters.amplicationWorkspaceId }}

  - id: register-in-catalog
    action: catalog:register
    input:
      catalogInfoUrl: https://github.com/acme-inc/platform/${{ parameters.serviceName }}/blob/main/catalog-info.yaml

Scaffold API and worker services in one run

Creates two related services in the same project using different service templates. Use this to set up an API and a background worker together.

Copy
steps:
  - id: scaffold-api
    action: amplication:scaffold-service
    input:
      name: ${{ parameters.serviceName }}-api
      description: Public API for ${{ parameters.serviceName }}
      project_id: ${{ parameters.amplicationProjectId }}
      serviceTemplate_id: 2b1d0f7e-7c3f-4d8c-9d57-2a6b1f1a9c30

  - id: scaffold-worker
    action: amplication:scaffold-service
    input:
      name: ${{ parameters.serviceName }}-worker
      description: Async worker for ${{ parameters.serviceName }}
      project_id: ${{ parameters.amplicationProjectId }}
      serviceTemplate_id: a1b2c3d4-5678-49ab-9abc-0def12345678

  - id: publish-monorepo
    action: publish:github
    input:
      repoUrl: github.com?owner=acme-inc&repo=${{ parameters.serviceName }}-services
      defaultBranch: main
      repoVisibility: private
      description: Monorepo for ${{ parameters.serviceName }} services

Scaffold with a composed service name and register in Backstage

Composes a service name from multiple parameters and registers the component in Backstage. Use this when you align service names with domain conventions and want immediate catalog visibility with [catalog:register](/backstage/scaffolder-actions/catal og-register/) and optional fetch:template.

Copy
steps:
  - id: fetch-docs
    action: fetch:template
    input:
      url: ./skeletons/docs-only
      targetPath: ./
      values:
        owner: ${{ parameters.owner }}
        system: ${{ parameters.system }}

  - id: scaffold-amplication-service
    action: amplication:scaffold-service
    input:
      name: ${{ parameters.domain }}-${{ parameters.serviceName }}-svc
      description: ${{ parameters.domain }} service for ${{ parameters.serviceName }}
      project_id: 7c2a9f1b-5d0a-4e1f-9c8a-2d1e4f6a8b9c
      serviceTemplate_id: 3f9d5c22-0b8a-4a1d-9f33-5b4a1c2d7e91
      workspace_id: ${{ parameters.amplicationWorkspaceId }}

  - id: register
    action: catalog:register
    input:
      catalogInfoUrl: https://github.com/acme-inc/${{ parameters.domain }}-${{ parameters.serviceName }}-svc/blob/main/catalog-info.yaml

Scaffold a service for a team project with GitHub publishing

Creates a team scoped service using a known service template and publishes a new repository. Use this for standardized service creation in a team project with publish:github.

Copy
steps:
  - id: scaffold-amplication-service
    action: amplication:scaffold-service
    input:
      name: payments-ledger
      description: Ledger service for payments reconciliation
      project_id: 54f0c9c3-1c2d-4a8e-9b77-19c2a9d6a0ef
      serviceTemplate_id: f71b2d60-9a55-4fa0-86b4-6f3f2f1e8d22

  - id: publish-repo
    action: publish:github
    input:
      repoUrl: github.com?owner=acme-payments&repo=payments-ledger
      defaultBranch: main
      repoVisibility: private
      description: Ledger service for payments reconciliation