-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add tutorial to try the plugins #258
Open
yayfeng
wants to merge
1
commit into
awslabs:main
Choose a base branch
from
yayfeng:add-tutorial
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,134 @@ | ||
# Tutorial | ||
# Tutorial: using the AWS plugins for Backstage | ||
|
||
Coming soon! | ||
The AWS plugins for Backstage enable you to integrate and manage AWS services directly within Backstage, providing a seamless experience for developers. This tutorial walks you through an example of using the AWS plugins for Backstage. | ||
|
||
Tutorial steps: | ||
|
||
<!-- toc --> | ||
|
||
1. [Prerequisites](#prerequisites) | ||
1. [Clone this repository](#clone-this-repository) | ||
1. [Create prerequisite AWS resources](#create-prerequisite-aws-resources) | ||
1. [Run the Backstage app locally](#run-the-backstage-app-locally) | ||
1. [Explore the Plugins](#explore-the-plugins) | ||
1. [Cleanup](#cleanup) | ||
<!-- tocstop --> | ||
|
||
## Prerequisites | ||
|
||
Before getting started, ensure you have: | ||
|
||
- An AWS account | ||
- Node.js (version 20 or later) | ||
- CDK CLI installed | ||
|
||
## Clone this repository | ||
|
||
Before we start, clone the repository to get access to the necessary sample code and configurations. | ||
|
||
``` | ||
git clone https://github.com/awslabs/backstage-plugins-for-aws.git | ||
cd backstage-plugins-for-aws | ||
``` | ||
|
||
## Create prerequisite AWS resources | ||
|
||
To get started, we'll deploy a sample AWS CDK project included in the repository. This project streamlines the setup process by automatically provisioning key resources, including an ECS cluster, an ECS service, and a CodePipeline that builds and deploys a container image. These resources enable you to interact with real data through the Backstage plugins, eliminating the need for manual configuration and allowing you to focus on exploring the plugin's functionality. | ||
|
||
Instructions | ||
|
||
1. Navigate to the CDK Project Directory | ||
|
||
Begin by navigating to the directory containing the CDK project: | ||
|
||
``` | ||
cd examples/cdk | ||
``` | ||
|
||
2. Install CDK Project Dependencies | ||
|
||
Inside the directory, install the required dependencies: | ||
|
||
``` | ||
yarn install | ||
``` | ||
|
||
3. Deploy the CDK Stack | ||
|
||
Deploy the sample AWS resources defined in the CDK stack: | ||
|
||
``` | ||
cdk deploy | ||
``` | ||
|
||
This will provision the AWS resources needed for your project, such as ECS clusters and services. | ||
|
||
Ensure your AWS credentials are configured properly before running the command. | ||
|
||
Deployment may take a few minutes. Once completed, your AWS resources will be ready for use. | ||
|
||
## Run the Backstage app locally | ||
|
||
With the sample resources in place, you can now run the Backstage app locally to see the plugins in action. The repository already includes pre-installed and configured plugins, so no additional setup is required. | ||
|
||
Use the following command to start the Backstage app: | ||
|
||
``` | ||
yarn dev | ||
``` | ||
|
||
Open your browser and navigate to `http://localhost:3000`, you should see list of entities in the catalog page: | ||
|
||
![My Company Catalog](./images/my-company-catalog.png) | ||
|
||
Click on the `example-website` component to open its details page: | ||
|
||
![Example Website](./images/example-website.png) | ||
|
||
The `example-website` entity is already loaded from the file system. The Backstage app includes an [entities.yaml](../examples/entities.yaml) file that defines this entity and its attributes. This entity is annotated with AWS specific metadata, such as: | ||
|
||
``` | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: example-website | ||
annotations: | ||
aws.amazon.com/aws-codepipeline-tags: component=example-website | ||
aws.amazon.com/aws-codebuild-project-tags: component=example-website | ||
aws.amazon.com/amazon-ecs-service-tags: component=example-website | ||
aws.amazon.com/cost-insights-tags: component=example-website | ||
``` | ||
|
||
You can view these annotations directly in Backstage using the `Inspect entity` feature: | ||
|
||
- Open the three dots menu in the top-right corner of the entity page. | ||
- Select `Inspect entity` from the dropdown. | ||
|
||
This will show the raw YAML configuration, where you can explore the entity's metadata and annotations. | ||
|
||
![Entity Overview](./images/entity-overview.png) | ||
|
||
These annotations link the entity to ECS services created by the CDK project, enabling the plugin to fetch and display relevant service details. This is achieved using AWS tags applied to the associated resources. You can review how these tags are defined and applied by checking the CDK project configuration [here](../examples/cdk/lib/cdk-stack.ts#L98). | ||
|
||
## Explore the Plugins | ||
|
||
CI/CD Tab: See build and deployment information. | ||
|
||
![Codepipeline tab](./images/codepipeline-tab.png) | ||
|
||
ECS Tab: View the status of ECS services associated with the entity. | ||
|
||
![ECS tab](./images/ecs-tab.png) | ||
|
||
## Cleanup | ||
|
||
Once you’ve explored the plugins, clean up the resources created by the CDK project to avoid unnecessary costs. | ||
|
||
Navigate back to the CDK directory and destroy the deployed stack: | ||
|
||
``` | ||
cd examples/cdk | ||
cdk destroy | ||
``` | ||
|
||
Confirm the prompt to delete all resources. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets rename the ECS cluster and service from "my-ecs..." to "example-website...."