Skip to content

Instantly share code, notes, and snippets.

@ricardochaves
Created November 6, 2019 21:51
Show Gist options
  • Save ricardochaves/79b9f6f5cf5b9f37b872b679b093ef59 to your computer and use it in GitHub Desktop.
Save ricardochaves/79b9f6f5cf5b9f37b872b679b093ef59 to your computer and use it in GitHub Desktop.
Recipe for Google Deployment Manager
def GenerateConfig(context):
"""Generate YAML resource configuration."""
ip_name = context.properties["IP_NAME"]
region = context.properties["REGION"]
resources = []
resources.append(
{
"name": ip_name,
"type": "compute.beta.address",
"properties": {
"description": "dev static IP",
"networkTier": "PREMIUM",
"addressType": "EXTERNAL",
"region": region,
},
}
)
outputs = []
outputs.append({"name": "address", "value": "$(ref." + ip_name + ".address)"})
return {"resources": resources, "outputs": outputs}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment