Skip to content

Commit

Permalink
build: COS variable namechanges
Browse files Browse the repository at this point in the history
Completed work to have consistent variable names across different
Terraform templates.

cos_bucket_name now set in terraform.tfvars and has no default as

has to be unique.

Removed cos_service_instance_name prefix. Set new default value.

Fixes confidential-containers#21

Signed-off-by: [Jonah-Farrow] <[email protected]>
  • Loading branch information
Jonah-F authored and stevenhorsman committed May 30, 2022
1 parent 8e85841 commit 4d3c3d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions ibmcloud/terraform/podvm-build/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ locals {
worker_ip = data.ibm_is_instance.worker.primary_network_interface[0].primary_ipv4_address
bastion_ip = data.ibm_is_floating_ip.worker.address
zone_name = data.ibm_is_subnet.primary.zone
cos_service_instance_name = var.cos_service_instance_name != null ? var.cos_service_instance_name : "${var.cluster_name}-cos-service-instance"
cos_bucket_name = var.cos_bucket_name != null ? var.cos_bucket_name : "${var.cluster_name}-cos-bucket"
ibmcloud_api_endpoint = var.use_ibmcloud_test ? "https://test.cloud.ibm.com" : "https://cloud.ibm.com"
is_policies_and_roles = flatten([
for policy in data.ibm_iam_user_policy.user_policies.policies: [
Expand Down Expand Up @@ -54,8 +52,8 @@ resource "local_file" "group_vars" {
ibmcloud_api_key: ${var.ibmcloud_api_key}
ibmcloud_api_endpoint: ${local.ibmcloud_api_endpoint}
ibmcloud_cos_service_instance: ${local.cos_service_instance_name}
ibmcloud_cos_bucket: ${local.cos_bucket_name}
ibmcloud_cos_service_instance: ${var.cos_service_instance_name}
ibmcloud_cos_bucket: ${var.cos_bucket_name}
ibmcloud_region_name: ${var.region_name}
ibmcloud_vpc_name: ${var.vpc_name}
ibmcloud_vpc_subnet_name: ${var.primary_subnet_name}
Expand Down
6 changes: 2 additions & 4 deletions ibmcloud/terraform/podvm-build/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ variable "primary_subnet_name" {
}

variable "cos_service_instance_name" {
default = null
default = "cos-image-instance"
}

variable "cos_bucket_name" {
default = null
}
variable "cos_bucket_name" {}

variable "use_ibmcloud_test" {
type = bool
Expand Down

0 comments on commit 4d3c3d1

Please sign in to comment.