Home > database >  How can we pass two agruments in Terraform import script?
How can we pass two agruments in Terraform import script?

Time:06-24

I need to import an existing order to terraform state. For example: Consider I need to pass ID and Environment values to import the script.

if we have to pass only one argument say ID, we can use the below script

terraform import hashicups_order.sample {id}

In my case I need to pass two arguments, we can say it id and environmentValue. So how can we do that?

terraform import hashicups_order.sample {id} {one more argument???}

CodePudding user response:

TF import has the following form

terraform import [options] ADDRESS ID

ADDRESS ID is a single value (not multiple values) uniquely identifying the resource to be imported.

If you wish to pass any other values to import you have to use -var in [options] as explained in the docs.

  • Related