I started working with Google Cloud Deployment Manager upon request of a client, using YAML config files, but I can't find anywhere how to map the reference shown in https://cloud.google.com/deployment-manager/docs/configuration/supported-resource-types to what I'm actually using.
Particularly, I need to attach an existent external elastic IP to an instance at creation time, but I can't find anywhere what is the config file schema to do so (i.e. like with eksctl
config file schema documentation found at https://eksctl.io/usage/schema/):
resources:
- type: compute.v1.instance
name: nextcloud-vm
properties:
natIP: nextcloud-vm
# The properties of the resource depend on the type of resource. For a list
# of properties, see the API reference for the resource.
zone: us-west1-a
# Replace martin-dev-391362 with your project ID
machineType: https://www.googleapis.com/compute/v1/projects/martin-dev-391362/zones/us-west1-a/machineTypes/n2-standard-4
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
# See a full list of image families at https://cloud.google.com/compute/docs/images#os-compute-support
# The format of the sourceImage URL is: https://www.googleapis.com/compute/v1/projects/[IMAGE_PROJECT]/global/images/family/[FAMILY_NAME]
sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts
diskSizeGb: 20
# Replace martin-dev-391362 with your project ID
networkInterfaces:
- network: https://www.googleapis.com/compute/v1/projects/martin-dev-391362/global/networks/default
# Access Config required to give the instance a public IP address
accessConfigs:
- name: nextcloud-vm
type: ONE_TO_ONE_NAT
The above code doesn't work because it tries to create a new IP address with that name instead of using the already existing elastic IP address. Thing is I can't find anywhere what is the correct notation :)
I'd really appreciate if anybody can point me to the right direction because solving this very little issue is just the tip of the iceberg, as I will be working a lot with Deployment Manager and thus I need to get the complete picture on how to work with it.