(context)
return {'resources': resources}
Generate YAML resource configuration.
Generate YAML resource configuration.
Generate YAML resource configuration .
def GenerateConfig(context):
  """Generate YAML resource configuration."""

  name = context.env['name']

  resources = [{
      'name': name,
      'type': 'container_instance_template.py',
      'properties': {
          'port': context.properties['port'],
          'dockerEnv': context.properties['dockerEnv'],
          'dockerImage': context.properties['dockerImage'],
          'containerImage': context.properties['containerImage']
      }
  }, {
      'name': name + '-pri',
      'type': 'autoscaled_group.py',
      'properties': {
          'zone': context.properties['primaryZone'],
          'size': context.properties['primarySize'],
          'maxSize': context.properties['maxSize'],
          'port': context.properties['port'],
          'service': context.properties['service'],
          'baseInstanceName': name + '-instance',
          'instanceTemplate': '$(ref.' + name + '-it.selfLink)'
      }
  }, {
      'name': name + '-sec',
      'type': 'autoscaled_group.py',
      'properties': {
          'zone': context.properties['secondaryZone'],
          'size': context.properties['secondarySize'],
          'maxSize': context.properties['maxSize'],
          'port': context.properties['port'],
          'service': context.properties['service'],
          'baseInstanceName': name + '-instance',
          'instanceTemplate': '$(ref.' + name + '-it.selfLink)'
      }
  }, {
      'name': name + '-hc',
      'type': 'compute.v1.httpHealthCheck',
      'properties': {
          'port': context.properties['port'],
          'requestPath': '/_ah/health'
      }
  }, {
      'name': name + '-bes',
      'type': 'compute.v1.backendService',
      'properties': {
          'port': context.properties['port'],
          'portName': context.properties['service'],
          'backends': [{
              'name': name + '-primary',
              'group': '$(ref.' + name + '-pri-igm.instanceGroup)'
          }, {
              'name': name + '-secondary',
              'group': '$(ref.' + name + '-sec-igm.instanceGroup)'
          }],
          'healthChecks': ['$(ref.' + name + '-hc.selfLink)']
      }
  }]
  return {'resources': resources}
def GenerateConfig ( context ) : name = context . env [ 'name' ] resources = [ { 'name' : name , 'type' : 'container_instance_template.py' , 'properties' : { 'port' : context . properties [ 'port' ] , 'dockerEnv' : context . properties [ 'dockerEnv' ] , 'dockerImage' : context . properties [ 'dockerImage' ] , 'containerImage' : context . properties [ 'containerImage' ] } } , { 'name' : name + '-pri' , 'type' : 'autoscaled_group.py' , 'properties' : { 'zone' : context . properties [ 'primaryZone' ] , 'size' : context . properties [ 'primarySize' ] , 'maxSize' : context . properties [ 'maxSize' ] , 'port' : context . properties [ 'port' ] , 'service' : context . properties [ 'service' ] , 'baseInstanceName' : name + '-instance' , 'instanceTemplate' : '$(ref.' + name + '-it.selfLink)' } } , { 'name' : name + '-sec' , 'type' : 'autoscaled_group.py' , 'properties' : { 'zone' : context . properties [ 'secondaryZone' ] , 'size' : context . properties [ 'secondarySize' ] , 'maxSize' : context . properties [ 'maxSize' ] , 'port' : context . properties [ 'port' ] , 'service' : context . properties [ 'service' ] , 'baseInstanceName' : name + '-instance' , 'instanceTemplate' : '$(ref.' + name + '-it.selfLink)' } } , { 'name' : name + '-hc' , 'type' : 'compute.v1.httpHealthCheck' , 'properties' : { 'port' : context . properties [ 'port' ] , 'requestPath' : '/_ah/health' } } , { 'name' : name + '-bes' , 'type' : 'compute.v1.backendService' , 'properties' : { 'port' : context . properties [ 'port' ] , 'portName' : context . properties [ 'service' ] , 'backends' : [ { 'name' : name + '-primary' , 'group' : '$(ref.' + name + '-pri-igm.instanceGroup)' } , { 'name' : name + '-secondary' , 'group' : '$(ref.' + name + '-sec-igm.instanceGroup)' } ] , 'healthChecks' : [ '$(ref.' + name + '-hc.selfLink)' ] } } ] return { 'resources' : resources }