0

I would like to connect my glans image to a specific project. How can I do this with terraform? I use openstack_images_image_access_v2 but it does not work

resource "openstack_images_image_v2" "upload_amphora_images" {
  for_each         =  var.regions
  name             = "amphora-x64-haproxy.qcow2"
  image_source_url = "https://minio.services.osism.tech/openstack-octavia-amphora-image/octavia-amphora-haproxy-zed.qcow2"
  container_format = "bare"
  disk_format      = "qcow2"
  visibility       = "shared"
  tags             = ["amphora",]
  region           = each.value.name
}

resource "openstack_images_image_access_v2" "amphora_images_member" {
  for_each  = var.regions
  image_id  = "${openstack_images_image_v2.upload_amphora_images[each.key].id}"
  member_id = "${data.openstack_identity_project_v3.default[each.key].id}"
  status    = "accepted"
  region    = each.value.name
}

module.glance_images.openstack_images_image_v2.upload_amphora_images["region01"]: Creation complete after 1m24s [id=f0e972e3-5c8d-439f-95cc-ab1f82f13574] module.glance_images.openstack_images_image_access_v2.amphora_images_member["region01"]: Creating... module.glance_images.openstack_images_image_access_v2.amphora_images_member["region01"]: Creation complete after 0s [id=f0e972e3-5c8d-439f-95cc-ab1f82f13574/1118f006e7894ab8a2293506d9d870f6]

Could anyone you ask me?

  • Have you tried removing the double quotes, i.e., `image_id = openstack_images_image_v2.upload_amphora_images[each.key].id`? – Marko E Feb 16 '23 at 18:09
  • @MarkoE I believe that is still valid syntax despite being deprecated for years. I would like to know what "it does not work" means considering the logs shared in the question imply success. – Matthew Schuchard Feb 16 '23 at 20:31
  • Hm, yeah, I thought it interprets it as a string literal. – Marko E Feb 16 '23 at 21:09
  • @MattSchuchard Yeap, you are right it is a success, but the project did not change. I try the owner of the images, but it does not work – Serhii Zharchynskyi Feb 18 '23 at 10:33

0 Answers0