Scroll to top
© 2022, SYNTONIZE Digital Pulse

Backstage + AWS: Setting up an Internal Developer Portal

How it works


apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
  name: Sales-Team
  description: The Sales division responsible for revenue generation.
spec:
  type: Tech-Unit
  profile:
    displayName: Sales Department
  members: [lucasberlang, adrijh]


integrations:
  github:
    - host: github.com
      token: ${GITHUB_TOKEN}

 

In our example repository we are using its integration with Github for entity discovery. Then it’s as simple as specifying the sources of our entities.


providers:
    github:
      catalog:
        organization: 'Syntonize'
        catalogPath: '/catalog/*.yaml'
        filters:
          branch: 'main'
          repository: '^backstage-foundry'
        schedule:
          frequency: { minutes: 5 }
          timeout: { minutes: 3 }
      templates:
        organization: 'Syntonize'
        catalogPath: '/templates/**/*.yaml'
        filters:
          branch: 'main'
          repository: '^backstage-foundry'
        schedule:
          frequency: { minutes: 5 }
          timeout: { minutes: 3 }
      docs:
        organization: 'Syntonize'
        catalogPath: 'techdocs/catalog-info.yaml'
        filters:
          branch: 'main'
          repository: '^backstage-foundry'
        schedule:
          frequency: { minutes: 5 }
          timeout: { minutes: 3 }

Backstage Catalog


apiVersion: backstage.io/v1alpha1
kind: Domain
metadata:
  name: Sales
  description: All systems related to sales operations and customer management.
spec:
  owner: Sales-Team 

Sales is a domain that owns multiple systems related to customer management.
It is owned by the Sales-Team, which is responsible for managing the associated systems.
System: A System consists of multiple components, APIs, and resources that work together to achieve a goal. In our example CRM System under Sales Domain:

apiVersion: backstage.io/v1alpha1
kind: System
metadata:
  name: CRM
  description: Manages customer relationships and sales pipelines.
spec:
  owner: Sales-Team
  domain: Sales

 

The CRM system is responsible for handling customer relationships.
It is owned by the Sales-Team and belongs to the Sales domain.
Component: A Component represents a service, data pipeline, or application that provides or consumes APIs. In our example CRM Backend Service:


apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: CRM-Backend
  description: Backend service for managing customer records.
spec:
  type: service
  owner: Sales-Team
  system: CRM
  providesAPI:
    - Customer-Data-API
  dependsOn:
    - Customer-Database

 

CRM-Backend is a backend service that manages customer records.
It provides the Customer-Data-API.
It depends on the Customer Database.
Group: A Group represents a team or business unit responsible for systems and components. In our example Sales-team group:


apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
  name: Sales-Team
  description: The Sales division responsible for revenue generation.
spec:
  type: Tech-Unit
  profile:
    displayName: Sales Department
  members: [lucasberlang, adrijh]

 


apiVersion: backstage.io/v1alpha1
kind: User
metadata:
  name: lucasberlang
  description: Lead engineer in the Sales department.
spec:
  memberOf: [Sales-Team]

How Everything Connects

Template Scaffolding


apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: aws-lambda-template
  title: AWS Lambda Python Template
  description: Scaffolder template for a python AWS Lambda
spec:
  owner: user:guest
  type: service

  parameters:
    - title: Choose Application Details
      required:
        - applicationName
      properties:
        applicationName:
          title: Application Name
          type: string
          description: Enter the name of your application
     - ...

  steps:
    - id: fetch-app
      name: Fetch App
      action: fetch:template
      input:
        url: ./app
        targetPath: ./app
        values:
          name: ${{ parameters.applicationName }}
          owner: ${{ parameters.owner }}
    - ...
    - id: publish-code
      name: Publish App
      action: github:repo:push
      input:
        sourcePath: ./app
        defaultBranch: dev
        description: Publish ${{ parameters.applicationName }} repository
        repoUrl: ${{ parameters.host}}?repo=${{ parameters.applicationName }}&owner=${{ parameters.owner }}
    - ..
outputs:
  ... 

Techdocs


apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: example-docs 
  annotations:
    backstage.io/techdocs-ref: dir:.
spec:
  type: documentation
  lifecycle: experimental
  owner: group:RnD-Lab

site_name: Example Techdocs
site_description: Our example docs
plugins:
  - techdocs-core
nav:
  - Home: index.md
  - A Section:
    - Subsection I: subsection_1.md
    - Subsection II: subsection_2.md

Deploying Backstage

Wrapping Up

           

Suscríbete a nuestra Newsletter.