Skip to content

Commit

Permalink
Changes to make VSI Provisioning in all regions
Browse files Browse the repository at this point in the history
  • Loading branch information
pkrishn1-pk committed Apr 23, 2020
1 parent ba7461e commit 870c9e5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ data "external" "delete_custom_image" {

query = {
custom_image_id = "${data.ibm_is_image.f5_custom_image.id}"
ibmcloud_endpoint = "${var.ibmcloud_endpoint}"
region = "${var.region}"
}
}

Expand Down
2 changes: 1 addition & 1 deletion image.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "${lookup(var.cos_image_url_region_mapping, data.ibm_is_region.region.name)}"
href = "cos://us-south/vnf-f5-bucket/BIGIP-15.0.1-0.0.11.qcow2"
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}"
Expand Down
4 changes: 2 additions & 2 deletions provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ variable "ibmcloud_svc_api_key" {
}

variable "region" {
default = "us-south"
description = "The VPC Region that you want your VPC, networks and the F5 virtual server to be provisioned in. To list available regions, run `ibmcloud is regions`."
default=""
description = "The Region where F5 virtual server to be provisioned in. To list available regions, run `ibmcloud is regions`."
}

variable "generation" {
Expand Down
23 changes: 11 additions & 12 deletions scripts/delete_custom_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,23 @@ function _log() {
####
function parse_input() {
_log "## Entering function: ${FUNCNAME[0]}"
eval "$(jq -r '@sh "custom_image_id=\(.custom_image_id) ibmcloud_endpoint=\(.ibmcloud_endpoint)"')"
eval "$(jq -r '@sh "custom_image_id=\(.custom_image_id) region=\(.region)"')"
_log "## Exiting function: ${FUNCNAME[0]}"
}

####
## USAGE: select_riaas_endpoint
## selecting the riaas endpoint based on the IBM end point and assigning to script variable.
## 1. ibmcloud_endpoint - IBM Cloud endpoint can be either cloud.ibm.com or test.cloud.ibm.com.
## As of now, there is no implementation to take the riaas end point
## from terraform. Hence, hot coded it.
####
## selecting the riaas endpoint based on the IBM Region and assigning to script variable.
##
function select_riaas_endpoint() {
if [ "$ibmcloud_endpoint" == "cloud.ibm.com" ]
then
rias_endpoint="https://us-south.iaas.cloud.ibm.com"
else
rias_endpoint="https://us-south-stage01.iaasdev.cloud.ibm.com"
fi
#if [ "$ibmcloud_endpoint" == "cloud.ibm.com" ]
#then
# rias_endpoint="https://us-south.iaas.cloud.ibm.com"
#else
# rias_endpoint="https://us-south-stage01.iaasdev.cloud.ibm.com"
#fi
rias_endpoint="https://$region.iaas.cloud.ibm.com"

}

####
Expand Down

0 comments on commit 870c9e5

Please sign in to comment.