Skip to content

Commit

Permalink
Feature/ephemeral storage (#185)
Browse files Browse the repository at this point in the history
## Description

Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Intermediate change (work in progress)

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] Test A
- [ ] Test B

## Checklist:

- [ ] Performed a self-review of my own code
- [ ] npm test passes on your machine
- [ ] New tests added or existing tests modified to cover all changes
- [ ] Code conforms with the style guide
- [ ] API Documentation in code was updated
- [ ] Any dependent changes have been merged and published in downstream
modules
  • Loading branch information
vijay-stephen authored Aug 1, 2024
1 parent e321196 commit 243ccaf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 16 deletions.
4 changes: 3 additions & 1 deletion terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Deployment of Backstage to an ECS Cluster

| Name | Source | Version |
|------|--------|---------|
| <a name="module_backstage"></a> [backstage](#module\_backstage) | sourcefuse/arc-backstage-ecs-app/aws | 0.2.6 |
| <a name="module_backstage"></a> [backstage](#module\_backstage) | sourcefuse/arc-backstage-ecs-app/aws | 0.2.8 |
| <a name="module_ecs_common_data"></a> [ecs\_common\_data](#module\_ecs\_common\_data) | ./ecs-common-data | n/a |
| <a name="module_tags"></a> [tags](#module\_tags) | sourcefuse/arc-tags/aws | 1.2.3 |

Expand All @@ -32,6 +32,7 @@ Deployment of Backstage to an ECS Cluster
|------|------|
| [aws_route53_zone.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
| [aws_ssm_parameter.container_image](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |
| [aws_ssm_parameter.repo_name](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |
| [aws_subnets.private](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source |
| [aws_subnets.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source |
| [aws_vpc.vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source |
Expand All @@ -50,6 +51,7 @@ Deployment of Backstage to an ECS Cluster
| <a name="input_deploy_backstage"></a> [deploy\_backstage](#input\_deploy\_backstage) | Deploy the Backstage image to the cluster. | `bool` | `true` | no |
| <a name="input_desired_count"></a> [desired\_count](#input\_desired\_count) | Number of ECS tasks to run for the health check. | `number` | `1` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `"poc"` | no |
| <a name="input_ephemeral_storage"></a> [ephemeral\_storage](#input\_ephemeral\_storage) | (optional) Ephemeral storage for task | `string` | `20` | no |
| <a name="input_execution_policy_attachment_arns"></a> [execution\_policy\_attachment\_arns](#input\_execution\_policy\_attachment\_arns) | The ARNs of the policies you want to apply | `list(string)` | <pre>[<br> "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"<br>]</pre> | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace for the resources. | `string` | n/a | yes |
| <a name="input_private_key_secret_name"></a> [private\_key\_secret\_name](#input\_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/sf-arc-poc2-backstage-private-key"` | no |
Expand Down
2 changes: 1 addition & 1 deletion terraform/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ data "aws_subnets" "private" {

# Define data sources for SSM parameters
data "aws_ssm_parameter" "repo_name" {
name = "/backstage/${var.environment}/repo/creator/name"
name = "/backstage/${var.environment}/repo/creator/name"
}
24 changes: 12 additions & 12 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ locals {
route_53_zone = trimprefix(var.acm_domain_name, "*.")
health_check_domain = "healthcheck-${var.namespace}-${var.environment}.${local.route_53_zone}"
environment_variables = [
{
name = "GITHUB_API_URL"
value = "https://api.github.com"
},
{
name = "GITHUB_ORGANIZATION"
value = "sourcefuse"
},
{
name = "REPO_CREATOR_TEAM"
value = data.aws_ssm_parameter.repo_name.value
},
{
name = "GITHUB_API_URL"
value = "https://api.github.com"
},
{
name = "GITHUB_ORGANIZATION"
value = "sourcefuse"
},
{
name = "REPO_CREATOR_TEAM"
value = data.aws_ssm_parameter.repo_name.value
},
]
}
3 changes: 2 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module "ecs_common_data" {
################################################################################
module "backstage" {
source = "sourcefuse/arc-backstage-ecs-app/aws"
version = "0.2.7"
version = "0.2.8"
alb_dns_name = module.ecs_common_data.alb_dns_name
alb_zone_id = module.ecs_common_data.alb_dns_zone_id
app_host_name = var.app_host_name
Expand All @@ -67,4 +67,5 @@ module "backstage" {
health_check_path_pattern = "/healthcheck"
desired_count = 2
environment_variables = local.environment_variables
ephemeral_storage = var.ephemeral_storage
}
3 changes: 2 additions & 1 deletion terraform/poc.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ region = "us-east-1"
environment = "poc"
acm_domain_name = "*.arc-poc.link"
#container_image_override = "884360309640.dkr.ecr.us-east-1.amazonaws.com/sourcefuse-backstage:0.1.0"
namespace = "arc"
namespace = "arc"
ephemeral_storage = 40
1 change: 1 addition & 0 deletions terraform/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ app_host_name = "dx.arc-prod.link"
namespace = "arc"
secret_name = "arc/prod/sf-arc-prod-backstage"
private_key_secret_name = "arc/prod/sf-arc-prod-backstage-private-key"
ephemeral_storage = 40
6 changes: 6 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ variable "route_53_private_zone" {
description = "Used with `name` field to get a private Hosted Zone"
default = false
}

variable "ephemeral_storage" {
type = string
description = "(optional) Ephemeral storage for task"
default = 20
}

0 comments on commit 243ccaf

Please sign in to comment.