I’m new to Terraform and evaluating it as a tool to help us manage our compute resource in the Oracle Public Cloud. I’m trying to import the current state of an opc_compute_instance and getting the following result:
> terraform import opc_compute_instance.instance INSTANCE/<id>
opc_compute_instance.instance: Importing from ID "INSTANCE/<id>"...
opc_compute_instance.instance: Import complete!
Imported opc_compute_instance (ID: <id>)
opc_compute_instance.instance: Refreshing state... (ID: <id>)
Error importing: 1 error(s) occurred:
* opc_compute_instance.instance (import id: INSTANCE/<id>): 1 error(s) occurred:
* import opc_compute_instance.instance result: <id>: import opc_compute_instance.instance (id: <id>): Terraform detected a resource with this ID doesn't exist. Please verify the ID is correct. You cannot import non-existent resources using Terraform import.
My .tf file looks like:
provider "opc" {
identity_domain = "xxxx"
endpoint = "https://xxxx.oraclecloud.com/"
user = "xxxx"
password = "xxxx"
}
resource "opc_compute_instance" "instance" {
name = "INSTANCE"
shape = "oc2m"
image_list = "/oracle/public/OL_6.6_10GB_x11"
}
Am I missing a step somewhere? The ‘terraform plan’ command does not object to the .tf file:
> terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
+ opc_compute_instance.instance
attributes: "<computed>"
availability_domain: "<computed>"
domain: "<computed>"
entry: "<computed>"
fingerprint: "<computed>"
hostname: "<computed>"
image_format: "<computed>"
image_list: "/oracle/public/OL_6.6_10GB_x11"
ip_address: "<computed>"
label: "<computed>"
name: "INSTANCE"
networking_info.#: "<computed>"
placement_requirements.#: "<computed>"
platform: "<computed>"
priority: "<computed>"
quota_reservation: "<computed>"
relationships.#: "<computed>"
resolvers.#: "<computed>"
reverse_dns: "true"
shape: "oc2m"
site: "<computed>"
start_time: "<computed>"
state: "<computed>"
vcable: "<computed>"
virtio: "<computed>"
vnc_address: "<computed>"
Plan: 1 to add, 0 to change, 0 to destroy.
Thanks,
Scott
---------------------------------------
Scott Parrill
Systems Administrator
IT/Telecom and System Support Services
University of Wyoming
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/CO2PR05MB6332727D53E508AF26CC68EBFC10%40CO2PR05MB633.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Hope you are doing good.
I also need some suggestion on terraform. Please do the needful.
- Suppose I am having directory- terraform and I placed my terraform exe(Binary) file there and more then one terraform- configuration.tf and Test.tf- My question is how can call individual .tf file from same directory or can we create separate .tf file for individual work and one common place for terraform.exe?
- Suppose I am having one .tf file and I applied the same, after one day i just add some more resource in same file, then how I can run those changes only insted of applying all the changes again?
- Just example- If i have create one cloud instance/server and added 1 boo-table and 1 persistent disk, and later wanted to add one more persistent disk then changed the same .tf file and used terraform inti command and then checked the plan but its show 1 object to be destroyed and when run its create new persistent storage but destroyed the instance and recreate and add new storage? but i just wanted to execute only newly added storage resource and add the same to instance without destroying the instance.
Please guide me on above doubt.
Thanks
Raj Gupta
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.