(context)
return resources
Generate configuration.
Generate configuration.
Generate configuration .
def GenerateConfig(context):
  """Generate configuration."""

  name_prefix = context.env['deployment'] + '-' + context.env['name']

  instance = {
      'zone': context.properties['zone'],
      'machineType': ZonalComputeUrl(
          context.env['project'], context.properties['zone'], 'machineTypes',
          'f1-micro'),
      'metadata': {
          'items': [{
              'key': 'startup-script',
              'value': context.properties['startup-script']
          }]
      },
      'disks': [{
          'deviceName': 'boot',
          'type': 'PERSISTENT',
          'autoDelete': True,
          'boot': True,
          'initializeParams': {
              'diskName': name_prefix + '-disk',
              'sourceImage': GlobalComputeUrl(
                  'debian-cloud', 'images', 'family/debian-9'
                  )
              },
          }],
      'networkInterfaces': [{
          'accessConfigs': [{
              'name': 'external-nat',
              'type': 'ONE_TO_ONE_NAT'
              }],
          'network': GlobalComputeUrl(
              context.env['project'], 'networks', 'default')
          }]
      }

  # Resources to return.
  resources = {
      'resources': [{
          'name': name_prefix + '-vm',
          'type': 'compute.v1.instance',
          'properties': instance
          }]
      }

  return resources
def GenerateConfig ( context ) : name_prefix = context . env [ 'deployment' ] + '-' + context . env [ 'name' ] instance = { 'zone' : context . properties [ 'zone' ] , 'machineType' : ZonalComputeUrl ( context . env [ 'project' ] , context . properties [ 'zone' ] , 'machineTypes' , 'f1-micro' ) , 'metadata' : { 'items' : [ { 'key' : 'startup-script' , 'value' : context . properties [ 'startup-script' ] } ] } , 'disks' : [ { 'deviceName' : 'boot' , 'type' : 'PERSISTENT' , 'autoDelete' : True , 'boot' : True , 'initializeParams' : { 'diskName' : name_prefix + '-disk' , 'sourceImage' : GlobalComputeUrl ( 'debian-cloud' , 'images' , 'family/debian-9' ) } , } ] , 'networkInterfaces' : [ { 'accessConfigs' : [ { 'name' : 'external-nat' , 'type' : 'ONE_TO_ONE_NAT' } ] , 'network' : GlobalComputeUrl ( context . env [ 'project' ] , 'networks' , 'default' ) } ] } # Resources to return. resources = { 'resources' : [ { 'name' : name_prefix + '-vm' , 'type' : 'compute.v1.instance' , 'properties' : instance } ] } return resources