Closed mjuenema closed 4 years ago
Currently the Python data source example in the Tutorial does not work. The reference to image.self_link results in "image": null in the JSON output.
image.self_link
"image": null
# Google Cloud Compute provider config += terrascript.provider.google(credentials='${file("account.json")}', project='myproject', region='us-central1') # Google Compute Image (Debian 9) data source image = terrascript.data.google_compute_image("image", family=IMAGE_FAMILY) config += image # Add Google Compute Instance resource config += terrascript.resource.google_compute_instance("myinstance", name="myinstance", machine_type=MACHINE_TYPE, zone="us-central1-a", boot_disk={ "initialize_params": { "image": image.self_link # <====== } }, network_interface={ "network": "default", "access_config": {} })
{ "provider": { "google": [ { "credentials": "${file(\"account.json\")}", "project": "myproject", "region": "us-central1" } ] }, "data": { "google_compute_image": { "image": { "family": "debian-9" } } }, "resource": { "google_compute_instance": { "myinstance": { "name": "myinstance", "machine_type": "n1-standard-1", "zone": "us-central1-a", "boot_disk": { "initialize_params": { "image": null # <====== } }, "network_interface": { "network": "default", "access_config": {} } } } } }
I think that's fixed
Currently the Python data source example in the Tutorial does not work. The reference to
image.self_link
results in"image": null
in the JSON output.