I am trying to create an instance-template, where a instance create with this template automatically gets an public ipv4 asigned.
Currently I am using something like following gcloud command:
gcloud compute instance-templates create TEMPLATENAME \
--project=PROJECT \
--machine-type=e2-small \
--network-interface=network=default,network-tier=PREMIUM \
--maintenance-policy=MIGRATE --provisioning-model=STANDARD \
--service-account=SERVICE_ACCOUNT \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--tags=http-server,https-server \
--create-disk=CREATE_DISK \
--no-shielded-secure-boot \
--shielded-vtpm \
--shielded-integrity-monitoring \
--reservation-affinity=any
This command is generated by the Google Cloud Console, but I have to use gcloud since I have to use a image-family to create the disk (which is to my knowledge not supported using gui).
If running this command I get the following result:
What am I missing?
In order to get an ephemeral IP adress
has to be set as empty string in the network interface flag.
--network-interface=network=default,network-tier=PREMIUM,adress=''