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

I've tried deploying using "google_compute_instance" resource but it is not working. We need image name, family name to deploy the image, how can i get that? #6760

Closed
ghost opened this issue Jul 8, 2020 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 8, 2020

This issue was originally opened by @bskrishna60 as hashicorp/terraform#25519. It was migrated here as a result of the provider split. The original body of the issue is below.


I'm trying to deploy CDAP VM (shorturl.at/qMN39) from GCP marketplace using terraform.

I've tried deploying using "google_compute_instance" resource but it is not working. We need image name, family name to deploy the image, how can i get that?

Link to GCP marketplace VM - https://console.cloud.google.com/marketplace/details/click-to-deploy-images/cdap?walkthrough_tutorial_id=java_gae_quickstart

@danawillow
Copy link
Contributor

Hi @bskrishna60, GCP Marketplace doesn't have built-in Terraform support right now, so there isn't a super easy way to do this. One option would be to create it from the marketplace and then import the VM into your terraform state. You could either use Terraform's native import functionality and then reconstruct the config file based on the state, or a tool like terraformer to try to write both the config and the state.

Because GCP Marketplace allows downloading a deployment manager config, you have two additional options:

  1. Read through the DM config and try to translate it into Terraform (the resources tend to align pretty closely on names/fields)
  2. Use the deployment manager resource in order to use deployment manager through terraform. Note that if you do that, you won't be able to manage it with a google_compute_instance resource so you should be sure that's what you want.

Personally I think the import solution is probably the easiest one, but up to you how you want to proceed.

@ghost
Copy link
Author

ghost commented Aug 13, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Aug 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant