This is the AWS CodePipeline plugin for backstage.io.
It provides:
- Entity content that displays the AWS CodePipeline executions related to that specific entity
- Entity card that displays the status of the AWS CodePipeline stages related to that specific entity
The plugin consists of the following packages:
frontend
: The frontend plugin package installed in Backstagebackend
: The backend plugin package installed in Backstagecommon
: Types and utilities shared between the packages
This guide assumes that you are familiar with the general Getting Started documentation and have assumes you have an existing Backstage application.
The IAM role(s) used by Backstage will require the following permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codepipeline:GetPipelineState",
"codepipeline:ListPipelineExecutions"
],
"Resource": "*"
}
]
}
Note: This policy does not reflect least privilege and you should further limit the policy to the appropriate AWS resources.
Install the backend package in your Backstage app:
yarn workspace backend add @aws/aws-codepipeline-plugin-for-backstage-backend
Add the plugin to the packages/backend/src/index.ts
:
const backend = createBackend();
// ...
backend.add(import('@aws/aws-codepipeline-plugin-for-backstage-backend'));
// ...
backend.start();
Verify that the backend plugin is running in your Backstage app. You should receive {"status":"ok"}
when accessing this URL:
https://<your backstage app>/api/aws-codepipeline/health
.
Install the frontend package in your Backstage app:
yarn workspace app add @aws/aws-codepipeline-plugin-for-backstage
Edit packages/app/src/components/catalog/EntityPage.tsx
to add AWS CodePipeline content to the CI/CD tab of the entity page:
import {
EntityAwsCodePipelineExecutionsContent,
isAwsCodePipelineAvailable,
} from '@aws/aws-codepipeline-plugin-for-backstage';
// For example in the CI/CD section
const cicdContent = (
<EntitySwitch>
<EntitySwitch.Case if= {isAwsCodePipelineAvailable} >
<EntityAwsCodePipelineExecutionsContent / >
</EntitySwitch.Case>
Edit the same file to add the AWS CodePipeline card to the entity page:
import { EntityAwsCodePipelineCard } from '@aws/aws-codepipeline-plugin-for-backstage';
// For example in the overview section
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
// ...
<Grid item md={6}>
<EntityAwsCodePipelineCard />
</Grid>
There are two annotations that can be used to reference CodePipeline resources for an entity.
The first will retrieve all CodePipeline resources with the matching tags, this is done with the aws.amazon.com/aws-codepipeline-tags
annotation:
# Example
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
# ...
annotations:
aws.amazon.com/aws-codepipeline-tags: component=myapp
spec:
type: service
# ...
Please review the Locating resources documentation to understand any additional configuration required for tag-based lookup.
The alternative is to reference a specific ECS service by ARN, this is done with the aws.amazon.com/aws-codepipeline-arn
annotation:
# Example
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
# ...
annotations:
aws.amazon.com/aws-codepipeline-arn: arn:aws:codepipeline:us-west-2:1234567890:myapp-pipeline
spec:
type: service
# ...
As a user of IAM Identity Center, you can make use of shortcut links by adding your AWS access portal subdomain to your app-config.yaml
:
aws:
sso:
subdomain: d-xxxxxxxxxx