Skip to content

Commit

Permalink
OCTOPUS-527: changing the targeted region due to access restriction o…
Browse files Browse the repository at this point in the history
…n ibm_is_image

Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
  • Loading branch information
prb112 committed Nov 2, 2023
1 parent c4bf459 commit c127d01
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/5_image/image.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ data "ibm_resource_group" "resource_group" {
name = var.resource_group_name
}

# Dev Note: with "global" location in some datacenters it'll fail as it can't find the bucket.
# Therefore we're using vpc_region
# Ref: https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints
resource "ibm_resource_instance" "cos_instance" {
name = "${var.name_prefix}-mac-intel-cos"
resource_group_id = data.ibm_resource_group.resource_group.id
# allow_cleanup = true // automatically decided by the service-broker
service = "cloud-object-storage"
plan = "standard"
location = "global"
location = var.vpc_region
}

resource "ibm_cos_bucket" "cos_bucket" {
Expand Down Expand Up @@ -71,6 +74,10 @@ locals {
cos_region = ibm_cos_bucket.cos_bucket.region_location
}

# Dev Note: This message occurs on single-zone regions.check
# > The IAM token that was specified in the request has expired or is invalid. The request is not authorized to access the Cloud Object Storage resource.
# ibmcloud is image-create test --file cos://au-syd/mac-f672-mac-intel/mac-f672-rhcos.qcow2 --os-name rhel-coreos-stable-amd64
# Ref: https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4267
resource "ibm_is_image" "worker_image_id" {
depends_on = [null_resource.upload_rhcos_image, ibm_cos_bucket.cos_bucket]
name = "${var.name_prefix}-rhcos-img"
Expand Down

0 comments on commit c127d01

Please sign in to comment.