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

  res = []
  base_name = (context.env['deployment'] + '-' +
               context.env['name'])

  # Properties for the container-based instance.
  instance = {
      'zone': context.properties['zone'],
      'machineType': ZonalComputeUrl(context.env['project'],
                                     context.properties['zone'],
                                     'machineTypes',
                                     'n1-standard-1'),
      'metadata': {
          'items': [{
              'key': 'gce-container-declaration',
              'value': context.imports[
                  context.properties['containerManifest']],
              }]
      },
      'disks': [{
          'deviceName': 'boot',
          'type': 'PERSISTENT',
          'autoDelete': True,
          'boot': True,
          'initializeParams': {
              'diskName': base_name + '-disk',
              'sourceImage': GlobalComputeUrl('cos-cloud',
                                              'images',
                                              context.properties[
                                                  'containerImage'])
              },
      }],
      'networkInterfaces': [{
          'accessConfigs': [{
              'name': 'external-nat',
              'type': 'ONE_TO_ONE_NAT'
              }],
          'network': GlobalComputeUrl(context.env['project'],
                                      'networks',
                                      'default')
      }],
      'serviceAccounts': [{
          'email': 'default',
          'scopes': [
            "https://www.googleapis.com/auth/logging.write",
            "https://www.googleapis.com/auth/monitoring.write"
          ]
      }]
  }
  res.append({
      'name': base_name,
      'type': 'compute.v1.instance',
      'properties': instance
  })
  # Resources to return.
  resources = {
      'resources': res,
  }

  return resources
def GenerateConfig ( context ) : res = [ ] base_name = ( context . env [ 'deployment' ] + '-' + context . env [ 'name' ] ) # Properties for the container-based instance. instance = { 'zone' : context . properties [ 'zone' ] , 'machineType' : ZonalComputeUrl ( context . env [ 'project' ] , context . properties [ 'zone' ] , 'machineTypes' , 'n1-standard-1' ) , 'metadata' : { 'items' : [ { 'key' : 'gce-container-declaration' , 'value' : context . imports [ context . properties [ 'containerManifest' ] ] , } ] } , 'disks' : [ { 'deviceName' : 'boot' , 'type' : 'PERSISTENT' , 'autoDelete' : True , 'boot' : True , 'initializeParams' : { 'diskName' : base_name + '-disk' , 'sourceImage' : GlobalComputeUrl ( 'cos-cloud' , 'images' , context . properties [ 'containerImage' ] ) } , } ] , 'networkInterfaces' : [ { 'accessConfigs' : [ { 'name' : 'external-nat' , 'type' : 'ONE_TO_ONE_NAT' } ] , 'network' : GlobalComputeUrl ( context . env [ 'project' ] , 'networks' , 'default' ) } ] , 'serviceAccounts' : [ { 'email' : 'default' , 'scopes' : [ "https://www.googleapis.com/auth/logging.write" , "https://www.googleapis.com/auth/monitoring.write" ] } ] } res . append ( { 'name' : base_name , 'type' : 'compute.v1.instance' , 'properties' : instance } ) # Resources to return. resources = { 'resources' : res , } return resources