(context)
return { 'resources': resources, 'outputs': outputs }
Generates configuration.
Generates configuration.
Generates configuration .
def GenerateConfig(context):
  """Generates configuration."""

  key_ring = {
    'name': 'keyRing',
    'type': 'gcp-types/cloudkms-v1:projects.locations.keyRings',
    'properties': {
      'parent': 'projects/' + context.env['project'] + '/locations/' + context.properties['region'],
      'keyRingId': context.env['deployment'] + '-key-ring'
    }
  }

  crypto_key = {
    'name': 'cryptoKey',
    'type': 'gcp-types/cloudkms-v1:projects.locations.keyRings.cryptoKeys',
    'properties': {
      'parent': '$(ref.keyRing.name)',
      'cryptoKeyId': context.env['deployment'] + '-crypto-key',
      'purpose': 'ENCRYPT_DECRYPT'
    }
  }

  resources = [key_ring, crypto_key]
  outputs = [{
    'name': 'primaryVersion',
    'value': '$(ref.cryptoKey.primary)'
  }]

  return { 'resources': resources, 'outputs': outputs }
def GenerateConfig ( context ) : key_ring = { 'name' : 'keyRing' , 'type' : 'gcp-types/cloudkms-v1:projects.locations.keyRings' , 'properties' : { 'parent' : 'projects/' + context . env [ 'project' ] + '/locations/' + context . properties [ 'region' ] , 'keyRingId' : context . env [ 'deployment' ] + '-key-ring' } } crypto_key = { 'name' : 'cryptoKey' , 'type' : 'gcp-types/cloudkms-v1:projects.locations.keyRings.cryptoKeys' , 'properties' : { 'parent' : '$(ref.keyRing.name)' , 'cryptoKeyId' : context . env [ 'deployment' ] + '-crypto-key' , 'purpose' : 'ENCRYPT_DECRYPT' } } resources = [ key_ring , crypto_key ] outputs = [ { 'name' : 'primaryVersion' , 'value' : '$(ref.cryptoKey.primary)' } ] return { 'resources' : resources , 'outputs' : outputs }