Skip to content

Commit 98e0596

Browse files
Merge pull request #14 from htc-demo-00-azure/s2s-secret
feat: set backstage service-to-service auth key
2 parents 225d4ea + 54f3692 commit 98e0596

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
@@ -92,6 +92,7 @@ Once you are finished with the reference architecture, you can remove all provis
9292
| helm | ~> 2.12 |
9393
| humanitec | ~> 1.0 |
9494
| kubernetes | ~> 2.25 |
95+
| random | ~> 3.5 |
9596

9697
### Providers
9798

@@ -100,6 +101,7 @@ Once you are finished with the reference architecture, you can remove all provis
100101
| azurerm | ~> 3.87 |
101102
| github | ~> 5.38 |
102103
| humanitec | ~> 1.0 |
104+
| random | ~> 3.5 |
103105

104106
### Modules
105107

@@ -128,6 +130,7 @@ Once you are finished with the reference architecture, you can remove all provis
128130
| [humanitec_application.backstage](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/application) | resource |
129131
| [humanitec_resource_definition_criteria.backstage_mysql](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
130132
| [humanitec_resource_definition_criteria.backstage_postgres](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
133+
| [humanitec_value.app_config_backend_auth_keys](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
131134
| [humanitec_value.backstage_cloud_provider](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
132135
| [humanitec_value.backstage_github_app_client_id](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
133136
| [humanitec_value.backstage_github_app_client_secret](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
@@ -137,6 +140,7 @@ Once you are finished with the reference architecture, you can remove all provis
137140
| [humanitec_value.backstage_github_org_id](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
138141
| [humanitec_value.backstage_humanitec_org](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
139142
| [humanitec_value.backstage_humanitec_token](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/value) | resource |
143+
| [random_bytes.backstage_service_to_service_auth_key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/bytes) | resource |
140144

141145
### Inputs
142146

examples/with-backstage/backstage-humanitec.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ resource "humanitec_value" "backstage_cloud_provider" {
7777
is_secret = false
7878
}
7979

80+
resource "random_bytes" "backstage_service_to_service_auth_key" {
81+
length = 24
82+
}
83+
84+
resource "humanitec_value" "app_config_backend_auth_keys" {
85+
app_id = humanitec_application.backstage.id
86+
key = "APP_CONFIG_backend_auth_keys"
87+
description = "Backstage service-to-service-auth keys"
88+
value = jsonencode([{
89+
secret = random_bytes.backstage_service_to_service_auth_key.base64
90+
}])
91+
is_secret = true
92+
}
93+
8094
# Configure required resources for backstage
8195

8296
locals {

examples/with-backstage/provider.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ terraform {
2828
source = "hashicorp/kubernetes"
2929
version = "~> 2.25"
3030
}
31+
random = {
32+
source = "hashicorp/random"
33+
version = "~> 3.5"
34+
}
3135
}
3236
required_version = ">= 1.3.0"
3337
}

0 commit comments

Comments
 (0)