Error:
Error: Invalid address
│
│ on line 1:
│ 1: google_access_context_manager_access_level.access_level.default
│
│ Resource instance key must be given in square brackets.
╵
For information on valid syntax, see:
I am using as per the documentation but still getting error. Kindly help.
I’m not sure what you were intending the .default portion of the address to do, but if it was the index for an individual instance, you would need to provide the address as
If that is literally what you are running then you are missing the final parameter. The terraform import command is as follows:
terraform import <resource name> <identifier>
Where the resource name has to match the full path to a resource block in the code, and the identifier is something used to match the resource in the cloud provider, etc. That identifier is provider & resource specific (for example in AWS it is often an ARN), so you’d need to lok at the provider docs: Terraform Registry
Hi Stuart,
Thanks for your reply.
As per the documentation I have first tried below in which “accessPolicies/590731782016/accessLevels/test_access_001” is the , but still luck.
As per the documentation I have first tried below in which “accessPolicies/590731782016/accessLevels/test_access_001” is the “identifier” , but still no luck.
I am now going to import a module and I have a question, do we need to have individual configuration for each resource in the module or Can I use directly the module as the configuration?
I mean if my module uses 10 resources, do I need to have 10 resource blocks as part of configuration, or one module will suffice?
Regards,
Amarnath.