This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud config set project softwaremill-playground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/GoogleCloudPlatform/deploymentmanager-samples.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources: | |
- name: the-first-vm | |
type: compute.v1.instance | |
properties: | |
zone: us-central1-f | |
machineType: https://www.googleapis.com/compute/v1/projects/[MY_PROJECT]/zones/us-central1-f/machineTypes/f1-micro | |
disks: | |
- deviceName: boot | |
type: PERSISTENT | |
boot: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources: | |
- name: the-first-vm | |
type: compute.v1.instance | |
properties: | |
zone: us-central1-f | |
machineType: https://www.googleapis.com/compute/v1/projects/[MY_PROJECT]/zones/us-central1-f/machineTypes/f1-micro | |
disks: | |
- deviceName: boot | |
type: PERSISTENT | |
boot: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Creates the virtual machine.""" | |
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/' | |
def GenerateConfig(unused_context): | |
"""Creates the first virtual machine.""" | |
resources = [{ | |
'name': 'the-first-vm', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Creates the virtual machine.""" | |
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/' | |
def GenerateConfig(unused_context): | |
"""Creates the second virtual machine.""" | |
resources = [{ | |
'name': 'the-second-vm', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imports: | |
- path: vm-template.py | |
- path: vm-template-2.py | |
resources: | |
- name: vm-1 | |
type: vm-template.py | |
- name: vm-2 | |
type: vm-template-2.py | |
- name: a-new-network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imports: | |
- path: vm-template.py | |
- path: vm-template-2.py | |
- path: network-template.py | |
- path: firewall-template.py | |
- path: compute-engine-template.py | |
resources: | |
- name: compute-engine-setup | |
type: compute-engine-template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Creates the Compute Engine.""" | |
def GenerateConfig(unused_context): | |
"""Creates the Compute Engine with network and firewall.""" | |
resources = [{ | |
'name': 'vm-1', | |
'type': 'vm-template.py' | |
}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Creates the virtual machine.""" | |
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/' | |
def GenerateConfig(context): | |
"""Creates the virtual machine with environment variables.""" | |
resources = [{ | |
'name': context.env['name'], |