diff --git a/image.tf b/image.tf index e26401f..133cc15 100644 --- a/image.tf +++ b/image.tf @@ -63,7 +63,7 @@ resource "random_uuid" "test" { } resource "ibm_is_image" "f5_custom_image" { depends_on = ["data.external.authorize_policy_for_image", "random_uuid.test"] - href = "cos://us-south/vnf-f5-bucket/BIGIP-15.0.1-0.0.11.qcow2" + href = "${lookup(var.vnf_cos_image_url_map, data.ibm_is_region.region.name)}" name = "${var.vnf_vpc_image_name}-${substr(random_uuid.test.result,0,8)}" operating_system = "centos-7-amd64" resource_group = "${data.ibm_resource_group.rg.id}" diff --git a/variables.tf b/variables.tf index fe242ee..296ee16 100644 --- a/variables.tf +++ b/variables.tf @@ -18,7 +18,7 @@ variable "vnf_cos_instance_id" { # The value for this variable is enter at offering # onbaording time.This variable is hidden from the user. ############################################################################## -variable "vnf_cos_image_url" { +variable "vnf_cos_image_url_map" { default = "" description = "The COS image object SQL URL for F5-BIGIP qcow2 image." } @@ -65,12 +65,4 @@ variable "vnf_profile" { variable "ibmcloud_endpoint" { default = "cloud.ibm.com" description = "The IBM Cloud environmental variable 'cloud.ibm.com' or 'test.cloud.ibm.com'" -} - -variable "cos_image_url_region_mapping" { - description = "mapping for cross-region replication" - default = { - "us-south" = "cos://us-south/vnf-f5-bucket/BIGIP-15.0.1-0.0.11.qcow2", - "eu-de" = "cos://eu-de/vnf-f5-frankfurt-bucket/BIGIP-15.0.1-0.0.11.qcow2" - } } \ No newline at end of file