Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Make ibm_resource_key resources linked to ibm_database resources more importable #1232

Closed
bstoutenburgh opened this issue Mar 26, 2020 · 1 comment · Fixed by #3441
Assignees
Labels
service/Cloud Databases Issues related to Cloud Databases service/Resource Management Issues related to Resource Manager or Resource controller Issues

Comments

@bstoutenburgh
Copy link

When doing an import of an existing ibm_resource_key, we have to add role and resource_instance_id to be ignored in its lifecycle management.

For role it seems like roleCrn the if/else block could be extended to look for crn in these cases. And for resource_instance_id you could use the source_crn parameter.

Terraform Version

0.12.24

Affected Resource(s)

Please list the resources as a list, for example:

  • ibm_resource_key

Terraform Configuration Files

Example config:

resource "ibm_database" "elasticsearch" {
  name              = var.name
  plan              = "standard"
  location          = var.region
  service           = "databases-for-elasticsearch"
  resource_group_id = data.ibm_resource_group.group.id

  members_memory_allocation_mb = var.total_memory_mb
  members_disk_allocation_mb   = var.total_disk_mb
  members_cpu_allocation_count = var.total_dedicated_cores
}

resource "ibm_resource_key" "service_key" {
  name                 = var.service_key_name
  role                 = "Editor"
  resource_instance_id = ibm_database.elasticsearch.id

  lifecycle {
    ignore_changes = [role, resource_instance_id]
  }
}
@a-wagener
Copy link

We have the same problem. In our case it was enough to set ignore_changes = [resource_instance_id]. And the state is not just missing role and resource_instance_id, there is also an additional but empty field timeouts.

@kavya498 kavya498 added service/Resource Management Issues related to Resource Manager or Resource controller Issues service/Cloud Databases Issues related to Cloud Databases labels Apr 5, 2021
kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Dec 14, 2021
@kavya498 kavya498 linked a pull request Dec 14, 2021 that will close this issue
kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Cloud Databases Issues related to Cloud Databases service/Resource Management Issues related to Resource Manager or Resource controller Issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants