Skip to content

Commit

Permalink
fix: make clustername lowercase so that s3 bucket names are valid (#260)
Browse files Browse the repository at this point in the history
Signed-off-by: ankitm123 <[email protected]>
  • Loading branch information
ankitm123 authored May 13, 2021
1 parent 4f88c9e commit 04a61b2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/backup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {

resource "aws_s3_bucket" "backup_bucket" {
count = var.enable_backup ? 1 : 0
bucket_prefix = "backup-${var.cluster_name}-"
bucket_prefix = "backup-${lower(var.cluster_name)}-"
acl = "private"
tags = {
Owner = "Jenkins-x"
Expand Down
2 changes: 0 additions & 2 deletions modules/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ data "aws_availability_zones" "available" {}

data "aws_caller_identity" "current" {}

data "aws_partition" "current" {}

// ----------------------------------------------------------------------------
// Define K8s cluster configuration
// ----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions modules/cluster/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ locals {

resource "aws_s3_bucket" "logs_jenkins_x" {
count = var.enable_logs_storage ? 1 : 0
bucket_prefix = "logs-${var.cluster_name}-"
bucket_prefix = "logs-${lower(var.cluster_name)}-"
acl = "private"
tags = {
Owner = "Jenkins-x"
Expand All @@ -26,7 +26,7 @@ resource "aws_s3_bucket" "logs_jenkins_x" {

resource "aws_s3_bucket" "reports_jenkins_x" {
count = var.enable_reports_storage ? 1 : 0
bucket_prefix = "reports-${var.cluster_name}-"
bucket_prefix = "reports-${lower(var.cluster_name)}-"
acl = "private"
tags = {
Owner = "Jenkins-x"
Expand All @@ -44,7 +44,7 @@ resource "aws_s3_bucket" "reports_jenkins_x" {

resource "aws_s3_bucket" "repository_jenkins_x" {
count = var.enable_repository_storage ? 1 : 0
bucket_prefix = "repository-${var.cluster_name}-"
bucket_prefix = "repository-${lower(var.cluster_name)}-"
acl = "private"
tags = {
Owner = "Jenkins-x"
Expand Down
2 changes: 1 addition & 1 deletion modules/vault/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data "aws_iam_user" "vault_user" {
resource "aws_s3_bucket" "vault-unseal-bucket" {
count = local.create_vault_resources ? 1 : 0

bucket_prefix = "vault-unseal-${var.cluster_name}-"
bucket_prefix = "vault-unseal-${lower(var.cluster_name)}-"
acl = "private"
tags = {
Name = "Vault unseal bucket"
Expand Down

0 comments on commit 04a61b2

Please sign in to comment.