Skip to content

Commit f339304

Browse files
Fix: bucket name length (#4)
* fix: make bucket name independant of filmdrop inputs to avoid bucket name length issues
1 parent 2cb5f12 commit f339304

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- Initial stand up of repo and successful test deployment after extracting console-ui from main filmdrop terraform modules repository ([2](https://github.com/Element84/terraform-aws-filmdrop-ui/pull/2))
1313
- Renaming from `console-ui` and all references to more idiomatic `filmdrop-ui` to align with rest of filmdrop ecosystem
14+
- Fix an edge case of bucket name length being too long due to filmdrop inputs
1415

1516
### Changed
1617

@@ -23,8 +24,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2324

2425
### Added
2526

26-
27-
2827
### Changed
2928

3029
### Fixed

filmdrop_ui.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ EOF
126126
}
127127

128128
resource "random_id" "suffix" {
129-
byte_length = 8
129+
byte_length = 4
130130
}
131131

132132
resource "aws_s3_bucket" "filmdrop_ui_source_config" {
133-
bucket = "${var.filmdrop_ui_bucket_name}-${random_id.suffix.hex}"
133+
bucket_prefix = lower(substr("filmdrop-ui-build-${random_id.suffix.hex}-", 0, 60))
134134
force_destroy = true
135135
}
136-
136+
# fd-321e4afe-git-console-content-2026010819341989050000000a-9ef1910d
137137
resource "aws_s3_bucket_ownership_controls" "filmdrop_ui_source_config_ownership_controls" {
138138
bucket = aws_s3_bucket.filmdrop_ui_source_config.id
139139
rule {

0 commit comments

Comments
 (0)