terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

ibm_pi_image has required pi_image_name that does not supply the name for the imported image

Open powellquiring opened this issue 1 year ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

vpc-transit/power_tf % tf version
OpenTofu v1.6.0
on darwin_arm64
+ provider registry.opentofu.org/hashicorp/time v0.10.0
+ provider registry.opentofu.org/ibm-cloud/ibm v1.61.0

Affected Resource(s)

  • ibm_pi_image

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "ibm_pi_image" "testacc_image" {
  #pi_image_name        = "aaaaaa"
  pi_cloud_instance_id = var.power.guid
  pi_image_id          = local.image_id

Expected Behavior

The pi_image_name should be the name of the created image.

Actual Behavior

The pi_image_name is required. The above configuration will not work:

╷
│ Error: Missing required argument
│
│   on power_test_instances_tf/power_test_instances.tf line 19, in resource "ibm_pi_image" "testacc_image":
│   19: resource "ibm_pi_image" "testacc_image" {
│
│ The argument "pi_image_name" is required, but no definition was found.
╵

Changing the name as indicated by the comment above to aaaaa:

  + resource "ibm_pi_image" "testacc_image" {
      + id                     = (known after apply)
      + image_id               = (known after apply)
      + pi_cloud_instance_id   = "f5c1621b-9983-4ffa-944b-25d29199c346"
      + pi_image_bucket_access = "public"
      + pi_image_id            = "4adda2e3-1603-430d-9502-907b4a2d0ba7"
      + pi_image_name          = "aaaaaa"
    }

But the image resource created when listed by the command line has a different name:

$ ic pi image list
{
    "images": [
        {
            "creationDate": "2024-01-16T17:36:43.000Z",
            "description": "",
            "href": "/pcloud/v1/cloud-instances/9d3d7381e9ef42fc996ccf25f25137bf/images/197f0286-2fc5-4154-baad-e49cf425111d",
            "imageID": "197f0286-2fc5-4154-baad-e49cf425111d",
            "lastUpdateDate": "2024-01-16T17:36:43.000Z",
            "name": "SLES15-SP5",
            "specifications": {
                "architecture": "ppc64",
                "containerFormat": "bare",
                "diskFormat": "raw",
                "endianness": "little-endian",
                "hypervisorType": "phyp",
                "imageType": "stock-fls",
                "operatingSystem": "sles"
            },
            "state": "active",
            "storagePool": "",
            "storageType": ""
        }
    ]
}

powellquiring avatar Jan 16 '24 17:01 powellquiring