in community/global_properties/py/vm.py [0:0]
def GenerateConfig(context):
global_properties = yaml.load(context.imports['global_properties.yaml'])
network_interface = {
'network': 'global/networks/default',
}
if global_properties['experiments']['EnableExternalIp']:
network_interface['accessConfigs'] = [{'type': 'ONE_TO_ONE_NAT'}]
return {
'resources': [{
'name':
'%s-%s' % (context.env['name'], 'prod'
if global_properties['env'] == 'PROD' else 'nonprod'),
'type':
'gcp-types/compute-v1:instances'
if global_properties['experiments']['EnableGcpTypes'] else
'compute.v1.instance',
'properties': {
'zone':
context.properties['zone'],
'machineType':
'zones/%s/machineTypes/f1-micro' %
(context.properties['zone']),
'networkInterfaces': [network_interface],
'disks': [{
'boot': True,
'autoDelete': True,
'initializeParams': {
'sourceImage':
'projects/debian-cloud/global/images/family/debian-9'
}
}]
}
}]
}