Complete Backstage Golden Path template for AWS infrastructure provisioning with GitLab CI and Terraform Enterprise.
backstage-setup/
βββ README.md # This file - overview
β
βββ backstage-golden-path/ # β READY-TO-USE TEMPLATE
β βββ README.md # Quick start guide
β βββ SETUP-INSTRUCTIONS.md # Detailed setup steps
β βββ setup.sh # Automated installation script
β βββ template.yaml # Backstage template definition
β βββ content/ # Template content files
β βββ .gitlab-ci.yml # GitLab CI pipeline
β βββ catalog-info.yaml # Backstage catalog entry
β βββ terraform/ # Terraform infrastructure
β β βββ main.tf # AWS resources (VPC, EC2, EKS)
β β βββ variables.tf # Configuration variables
β β βββ outputs.tf # Infrastructure outputs
β βββ scripts/ # Deployment scripts
β βββ install-docker.sh # Docker installation
β βββ install-kubectl.sh # kubectl installation
β βββ install-helm.sh # Helm installation
β βββ deploy-app.sh # Application deployment
β
βββ backstage-golden-path-template.yaml # Original template (reference)
βββ backstage-template-content/ # Original content (reference)
βββ backstage-golden-path-installation.md # Complete deployment guide
Run the automated setup script:
cd /Users/smarticle/backstage-setup/backstage-golden-path
./setup.shThis will:
- Find your Backstage installation
- Copy template files to the correct location
- Show you the next steps
Before running the setup:
- β
Backstage running at
http://localhost:3000 - β GitLab account + personal access token
- β Terraform Cloud account + API token
- β AWS credentials
- backstage-golden-path/README.md - Quick start & overview
- backstage-golden-path/SETUP-INSTRUCTIONS.md - Detailed setup guide
- backstage-golden-path-installation.md - Complete deployment documentation
User fills form in Backstage
β
Creates GitLab repository
β
GitLab CI Pipeline starts
β
Stage 1: Terraform Enterprise provisions infrastructure
- VPC, Subnets, Security Groups
- EC2 instances
- Optional EKS cluster
β
Stage 2: Deploy applications
- SSH to new EC2 instances
- Install Docker, kubectl, Helm
- Deploy applications
β
Stage 3: Verify deployment
- Run health checks
- Report status
β
View in Backstage catalog
- Form-driven infrastructure creation
- Integrated with GitLab for repository creation
- Automatic catalog registration
- Pipeline status visibility
- Validate: Terraform format and validation
- Plan: Infrastructure planning
- Provision: AWS resource creation (manual approval)
- Deploy: Application deployment to EC2/EKS
- Verify: Health checks and validation
- Virtual Private Cloud (VPC)
- EC2 instances with security groups
- Optional EKS cluster for Kubernetes
- Configurable instance types and regions
- Automated Docker installation
- Kubernetes tools (kubectl, Helm)
- Application deployment automation
- Health check scripts
# Navigate to the template directory
cd /Users/smarticle/backstage-setup/backstage-golden-path
# Run setup script
./setup.sh
# Follow the prompts and instructionsAdd to your app-config.yaml:
catalog:
locations:
- type: file
target: ./templates/aws-infrastructure-golden-path/template.yaml
rules:
- allow: [Template]
integrations:
gitlab:
- host: gitlab.com
token: ${GITLAB_TOKEN}export GITLAB_TOKEN="your-gitlab-personal-access-token"
export TFE_TOKEN="your-terraform-cloud-token"
export TFE_ORGANIZATION="your-terraform-org"- Open
http://localhost:3000 - Click "Create" in sidebar
- Select "AWS Infrastructure Golden Path"
- Fill out the form
- Watch the magic happen! β¨
- AWS Regions: us-east-1, us-west-2, eu-west-1, ap-southeast-1
- Environments: dev, staging, production
- Instance Types: t3.micro, t3.small, t3.medium, t3.large
- Kubernetes: Optional EKS cluster
- Networking: Configurable VPC CIDR blocks
- EC2 instance deployment with Docker
- Kubernetes deployment with kubectl
- Helm chart deployment
- Custom Docker images or build from Dockerfile
- Automated Terraform validation
- Infrastructure planning with cost estimates
- Manual approval for production changes
- Automated deployment scripts
- Health check verification
- Rollback on failure
Edit backstage-golden-path/content/terraform/main.tf to add:
- RDS databases
- ElastiCache clusters
- S3 buckets
- CloudFront distributions
- Lambda functions
Edit backstage-golden-path/content/.gitlab-ci.yml to:
- Add testing stages
- Include security scanning
- Add notification steps
- Customize deployment logic
Create new scripts in backstage-golden-path/content/scripts/:
- Monitoring setup (CloudWatch, Datadog)
- Security hardening
- Application configuration
- Database migrations
# Verify files were copied
ls -la /path/to/backstage/templates/aws-infrastructure-golden-path/
# Check catalog configuration
cat /path/to/backstage/app-config.yaml | grep -A 10 "catalog:"
# Refresh catalog
curl -X POST http://localhost:3000/api/catalog/refresh- Verify token:
echo $GITLAB_TOKEN - Check token scopes:
api,read_repository,write_repository - Test GitLab API:
curl -H "PRIVATE-TOKEN: $GITLAB_TOKEN" https://gitlab.com/api/v4/user
Run manually:
# Find Backstage
ls -la ~ | grep backstage
# Copy files manually
BACKSTAGE_PATH="/path/to/your/backstage"
cp -r backstage-golden-path/* $BACKSTAGE_PATH/templates/aws-infrastructure-golden-path/For questions or issues:
- Check the detailed documentation in each folder
- Review the troubleshooting sections
- Consult the official documentation links above
- The
backstage-template-content/folder contains the original template files (kept for reference) - The
backstage-golden-path/folder is the active, ready-to-use template - All scripts are tested on macOS and Amazon Linux 2
Start by running:
cd backstage-golden-path
./setup.shHappy infrastructure provisioning! π