Skip to content

Commit 60e55c7

Browse files
Merge pull request #23 from htc-demo-00/s2s-secret
feat: set backstage service-to-service auth key
2 parents 81ce951 + a23c0cd commit 60e55c7

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

examples/with-backstage/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Once you are finished with the reference architecture, you can remove all provis
7676
| aws | ~> 5.17 |
7777
| github | ~> 5.38 |
7878
| humanitec | ~> 1.0 |
79+
| random | ~> 3.5 |
7980

8081
### Providers
8182

@@ -84,6 +85,7 @@ Once you are finished with the reference architecture, you can remove all provis
8485
| aws | ~> 5.17 |
8586
| github | ~> 5.38 |
8687
| humanitec | ~> 1.0 |
88+
| random | ~> 3.5 |
8789

8890
### Modules
8991

@@ -118,6 +120,7 @@ Once you are finished with the reference architecture, you can remove all provis
118120
| [humanitec_resource_definition_criteria.backstage_mysql](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
119121
| [humanitec_resource_definition_criteria.backstage_postgres](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
120122
| [humanitec_resource_definition_criteria.backstage_workload](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
123+
| [humanitec_value.app_config_backend_auth_keys](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
121124
| [humanitec_value.aws_default_region](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
122125
| [humanitec_value.backstage_cloud_provider](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
123126
| [humanitec_value.backstage_github_app_client_id](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
@@ -128,6 +131,7 @@ Once you are finished with the reference architecture, you can remove all provis
128131
| [humanitec_value.backstage_github_org_id](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
129132
| [humanitec_value.backstage_humanitec_org](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
130133
| [humanitec_value.backstage_humanitec_token](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
134+
| [random_bytes.backstage_service_to_service_auth_key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/bytes) | resource |
131135

132136
### Inputs
133137

examples/with-backstage/backstage-humanitec.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@ resource "humanitec_value" "aws_default_region" {
8585
is_secret = false
8686
}
8787

88+
resource "random_bytes" "backstage_service_to_service_auth_key" {
89+
length = 24
90+
}
91+
92+
resource "humanitec_value" "app_config_backend_auth_keys" {
93+
app_id = humanitec_application.backstage.id
94+
key = "APP_CONFIG_backend_auth_keys"
95+
description = "Backstage service-to-service-auth keys"
96+
value = jsonencode([{
97+
secret = random_bytes.backstage_service_to_service_auth_key.base64
98+
}])
99+
is_secret = true
100+
}
101+
88102
# Configure required resources for backstage
89103

90104
locals {

examples/with-backstage/provider.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ terraform {
1212
source = "integrations/github"
1313
version = "~> 5.38"
1414
}
15+
random = {
16+
source = "hashicorp/random"
17+
version = "~> 3.5"
18+
}
1519
}
1620
required_version = ">= 1.3.0"
1721
}

0 commit comments

Comments
 (0)