Hi, I am creating a Image on GCP and exporting it to GCS bucket but facing
issue.
Error: ==> googlecompute.basic-example (googlecompute-export): Error
creating instance: googleapi: Error 400: Invalid value for field
'resource.networkInterfaces[0].network': 'global/networks/default'. The
referenced network resource cannot be found., invalid
This is my packer template file.
packer {
required_plugins {
googlecompute = {
version = ">= 0.0.1"
source = "github.com/hashicorp/googlecompute"
}
}
}
source "googlecompute" "basic-example" {
project_id = var.project_id
source_image = var.source_image
image_name = local.image_name
image_description = var.image_description
instance_name = var.insatnec_name
machine_type = "n1-standard-1"
ssh_username = var.ssh_username
zone = var.zone
network = var.network
network_project_id = var.network_project_id
subnetwork = "projects/XXX/regions/us-east4/subnetworks/XXX"
use_internal_ip = var.use_internal_ip
omit_external_ip = var.omit_external_ip
use_os_login = var.use_os_login
}
build {
sources = ["sources.googlecompute.basic-example"]
provisioner "shell" {
script = "/home/YYYY/packers/script.sh"
}
post-processor "compress" {
output = "wordpress.tar.gz"
}
post-processor "googlecompute-export" {
paths = [
"gs://bucket-name/wordpress.tar.gz"
]
keep_input_artifact = true
}
}
--
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/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/44e053cb-2913-41e0-bd7f-618689137319n%40googlegroups.com.