arc-backstage-ecs-app¶
Overview¶
Terraform Module to run Backstage as an ECS app.
Upstream dependencies:
- PostgreSQL Database and Service Account. See the Backstage Docs for more info. See our ARC DB module for the simplest set up.
- ECS Cluster with an already configured HTTPS listener for an ALB. See our ARC ECS module for the simplest integration.
- Route53 Zone for an A record for Backstage
- Backstage image that can be pulled from ECR or DockerHub. Private DockerHub registries will require additional configuraiton.
- Secret in secrets manager with the following properties.
Usage¶
Note: the example below is does not have a pinned version. Be sure to pin your version. Refer to the example
folder for a working example version.
Requirements¶
Name | Version |
---|---|
terraform | ~> 1.3 |
aws | ~> 4.0 |
Providers¶
Name | Version |
---|---|
aws | 4.60.0 |
Modules¶
Name | Source | Version |
---|---|---|
backstage_container_definition | ./ecs-container-definition | n/a |
ecs_service_autoscaling | git::https://github.com/cn-terraform/terraform-aws-ecs-service-autoscaling | 1.0.6 |
Resources¶
Name | Type |
---|---|
aws_ecs_service.this | resource |
aws_ecs_task_definition.this | resource |
aws_iam_policy.secrets_manager_read_policy | resource |
aws_iam_role.execution | resource |
aws_iam_role_policy_attachment.execution | resource |
aws_iam_role_policy_attachment.secrets_manager_read | resource |
aws_lb_listener_rule.forward | resource |
aws_lb_target_group.this | resource |
aws_route53_record.this | resource |
aws_security_group.this | resource |
aws_iam_policy_document.assume | data source |
aws_route53_zone.this | data source |
aws_secretsmanager_secret.backstage_private_key | data source |
aws_secretsmanager_secret.backstage_secret | data source |
Inputs¶
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_dns_name | ALB DNS name to create A record for health check service | string |
n/a | yes |
alb_zone_id | ALB Route53 zone ID to create A record for health check service | string |
n/a | yes |
app_host_name | Host name to expose via Route53 | string |
n/a | yes |
app_port_number | Port number for the container to run under | number |
7007 |
no |
backstage_environment | Backstage environment | string |
"production" |
no |
cluster_id | ID of the ECS cluster. | string |
n/a | yes |
cluster_name | Name of the ECS cluster. | string |
n/a | yes |
container_image | url for image being used to setup backstage | string |
"spotify/backstage-cookiecutter" |
no |
desired_count | Number of ECS tasks to run for the service. | number |
3 |
no |
egress_cidr_block | ECS Tasks egress CIDR block | string |
"0.0.0.0/0" |
no |
environment | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | string |
n/a | yes |
environment_variables | (optional) List of additional environment variables | list(object({ |
[] |
no |
ephemeral_storage | (optional) The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is 21 GiB and the maximum supported value is 200 GiB. | string |
null |
no |
execution_policy_attachment_arns | The ARNs of the policies you want to apply | list(string) |
[ |
no |
health_check_path_pattern | Path pattern to match against the request URL. | string |
"/" |
no |
launch_type | Launch type for the health check service. | string |
"FARGATE" |
no |
lb_listener_arn | ARN of the load balancer listener. | string |
n/a | yes |
lb_security_group_ids | LB Security Group IDs for ingress access to the health check task definition. | list(string) |
n/a | yes |
max_count | Maximum number of ECS tasks to run for the service. | number |
6 |
no |
min_count | Minimum number of ECS tasks to run for the service. | number |
1 |
no |
private_key_secret_name | Name of the secret in AWS Secrets Manager that contains Backstage private key for GitHub authentication. The secret should be stored as plain text in ASM. | string |
"arc/poc/backstage-private-key" |
no |
route_53_private_zone | Used with name field to get a private Hosted Zone |
bool |
false |
no |
route_53_record_type | Health check Route53 record type | string |
"A" |
no |
route_53_records | List of A record domains to create for the health check service | list(string) |
n/a | yes |
route_53_zone_name | Route53 zone name used for looking up and creating an A record for the health check service |
string |
n/a | yes |
secret_list | (optional) List of additional Secrets | list(object({ |
[] |
no |
secret_name | Name of the secret in AWS Secrets Manager that contains Backstage secrets, such as POSTGRES_USER and POSTGRES_PASSWORD | string |
"arc/poc/backstage" |
no |
subnet_ids | Subnet IDs to run health check task in | list(string) |
n/a | yes |
tags | Tags to assign the resources. | map(string) |
{} |
no |
task_definition_cpu | Number of cpu units used by the task. If the requires_compatibilities is FARGATE this field is required. | number |
1024 |
no |
task_definition_memory | Amount (in MiB) of memory used by the task. If the requires_compatibilities is FARGATE this field is required. | number |
2048 |
no |
vpc_id | Id of the VPC where the resources will live | string |
n/a | yes |
Outputs¶
No outputs.
Git commits¶
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
For Example
Development¶
Prerequisites¶
Configurations¶
- Configure pre-commit hooks
Authors¶
This project is authored by below people
- SourceFuse ARC Team