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
The following simple Terraform creates a VPC block storage volume.
terraform {
required_version = "~>1.5"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "~>1.67.1"
}
}
}
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
region = var.region
}
variable "ibmcloud_api_key" {
description = "API key for use by this Terraform module."
type = string
sensitive = true
}
variable "region" {
description = "Region where resources will be provisioned."
type = string
default = "ca-tor"
}
variable "prefix" {
description = "Name prefix for common resources."
type = string
default = "bug"
}
# Resource group
resource "ibm_resource_group" "rg" {
name = var.prefix
}
resource "ibm_is_volume" "volume" {
name = "${var.prefix}-volume"
resource_group = ibm_resource_group.rg.id
zone = "${var.region}-1"
capacity = 100
profile = "general-purpose"
}
The problem is that the plan for this Terraform shows that it will set catalog_offering to a value known after apply, but after applying, it is null in the terraform.tfstate. Next time you plan, it wants to set catalog_offering again. You can apply indefinitely, but the planned state is never in sync with the actual state.
Steps to Reproduce
Create a terraform.tfvars with an ibmcloud_api_key for your account.
Run terraform init.
Run terraform apply.
Run terraform plan.
Expected Behavior
The apply correctly creates the resources.
The subsequent plan shows no actions.
Actual Behavior
The subsequent plan shows an action:
Terraform will perform the following actions:
# ibm_is_volume.volume will be updated in-place
~ resource "ibm_is_volume" "volume" {
+ catalog_offering = (known after apply)
id = "r038-f3bbc298-bbed-4e9c-8ca3-583edf28838b"
name = "bug-volume"
tags = []
# (19 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Important Factoids
This problem appeared for me when trying to upgrade from version 1.63.0 of the provider to 1.67.1.
Also, while creating this bug report, I found it extremely slow to refresh state for the volume several times. However, at some point, the performance become more normal.
Community Note
Terraform CLI and Terraform IBM Provider Version
Affected Resource(s)
Terraform Configuration Files
The following simple Terraform creates a VPC block storage volume.
The problem is that the plan for this Terraform shows that it will set
catalog_offering
to a value known after apply, but after applying, it is null in theterraform.tfstate
. Next time you plan, it wants to setcatalog_offering
again. You can apply indefinitely, but the planned state is never in sync with the actual state.Steps to Reproduce
terraform.tfvars
with anibmcloud_api_key
for your account.terraform init
.terraform apply
.terraform plan
.Expected Behavior
The apply correctly creates the resources. The subsequent plan shows no actions.
Actual Behavior
The subsequent plan shows an action:
Important Factoids
This problem appeared for me when trying to upgrade from version 1.63.0 of the provider to 1.67.1.
Also, while creating this bug report, I found it extremely slow to refresh state for the volume several times. However, at some point, the performance become more normal.