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

Unable to change region after instance is created or specify a different region than the provider. #112

Open
charlesomer opened this issue Sep 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@charlesomer
Copy link

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 "me too" comments, 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 Version and Provider Version

Terraform v1.5.6
on darwin_amd64
+ provider registry.terraform.io/oracle/oci v5.11.0

Affected Resource(s)

oci_core_instance

Terraform Configuration Files

module "instance" {
  source = "oracle-terraform-modules/compute-instance/oci"

  instance_count              = 1
  compartment_ocid            = var.compartment_id
  shape                       = "VM.Standard.A1.Flex"
  source_ocid                 = lookup(data.oci_core_images.ampere_ubuntu_images.images[0], "id")
  subnet_ocids                = [var.subnet_id]
  ssh_authorized_keys         = "~/.ssh/id_rsa.pub"
  instance_flex_memory_in_gbs = 6
  instance_flex_ocpus         = 1
}

Debug Output

Panic Output

Expected Behavior

Be able to specify a region separately to the provider config.

Actual Behavior

Uses region of provider at the time the instance was created even if changed later on.

Steps to Reproduce

  1. terraform apply to create an instance.
  2. Change provider region.
  3. terraform apply
  4. Should say no changes required.

Or just try to specify a different region than the provider. Apologies if this is already possible somehow and I've missed it!

Important Factoids

References

@charlesomer charlesomer added the bug Something isn't working label Sep 1, 2023
@kral2
Copy link
Contributor

kral2 commented Sep 2, 2023

Did you update the subnet ocid, so it matches something that exists in the new region? Also, is the data source refreshed first to target the image's new OCID for the new region?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants