-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Importing resources with a project ID that differs to the provider project #1676
Comments
terraform import
I've just noticed that some resources (specifically, the google_compute_global_address resource) supports specifying the project: https://www.terraform.io/docs/providers/google/r/compute_global_address.html#import So it looks like this would be the best method to support this feature? If so I'd be happy to PR the change.. |
Hey @roobert! Thanks for opening this bug, I appreciate it. As you mentioned, Global Addresses (and other resources) have a template of how we usually resolve this, and I think we'd like to follow that approach here, for consistency. I see you've opened a PR for this. Thanks! I'll go ahead and review the code and we can hopefully get this fixed ASAP. |
Just ran into this same issue with |
This was resolved for managed zone and any Magic Modules generated resources support this feature automatically. If anyone wants this on a specific resource that doesn't support it already, please file a new issue! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Hi,
As requested by @paddycarver I'm opening this issue to discuss a feature request regarding cross-gcp-project importing of resources.
It's is currently possible to create resource definitions which cannot be easily imported, specifically, when specifying the
project
parameter on a resource.For example:
Although this config is valid and can be used to create/update/delete the managed zone for
example-com
intest1
, if the zone exists already, it is not possible to import the resource into the state file usingterraform import
.There are a couple of possibilities here:
as suggested by @duckfez - create a secondary google provider with an alias such as
google-test1
and then useterraform import -provider google-test1
. This could potentially work and seems like the provider agnostic solution but is somewhat clumsy.update the terraform resources import templates to support including the project name.
e.g:
This solution would be the ideal solution, however I'm not sure if there are any standards or limitations on how
terraform import
should function regarding permitting additional parameters and allowing sensible defaults.If limitations do exist and it's necessary to update all of the
terraform import
templates to include theproject
parameter, is it feasible and would that be an acceptable change?If anyone can think of any other solutions I'd be interested in hearing them.
The text was updated successfully, but these errors were encountered: