Skip to content

Commit c8338ba

Browse files
committed
Fix service account names to be <= 30 characters long
1 parent c0cd65d commit c8338ba

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 0.7.6 (Dec 17, 2024)
2+
* Truncate image pusher service account name so it's less than max allowed of 30 characters.
3+
* Fix deployer service account name so it's less than max allowed of 30 characters.
4+
5+
# 0.7.5 (Dec 09, 2024)
6+
* Remove unnecessary permissions to read from artifact registry.
7+
8+
# 0.7.4 (Dec 09, 2024)
9+
* Fix service account to read from artifact registry.
10+
111
# 0.7.3 (Dec 06, 2024)
212
* Create unique name for artifact repo member.
313

deployer.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
locals {
2-
truncated_len = min(length(local.block_ref), 28 - length("deployer--12345"))
3-
deployer_name = "deployer-${substr(local.block_ref, 0, local.truncated_len)}-${random_string.resource_suffix.result}"
2+
max_deployer_name_len = 30 - length("deployer--12345")
3+
deployer_name = "deployer-${substr(local.block_ref, 0, local.max_deployer_name_len)}-${random_string.resource_suffix.result}"
44
}
55

66
resource "google_service_account" "deployer" {

pusher.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
locals {
2+
max_pusher_name_len = 30 - length("pusher--12345")
3+
pusher_name = "pusher-${substr(local.block_ref, 0, local.max_pusher_name_len)}-${random_string.resource_suffix.result}"
4+
}
5+
16
resource "google_service_account" "image_pusher" {
2-
account_id = "pusher-${local.resource_name}"
7+
account_id = local.pusher_name
38
display_name = "Image Pusher for ${local.app_name}"
49
}
510

0 commit comments

Comments
 (0)