Skip to content

Commit

Permalink
lab infra
Browse files Browse the repository at this point in the history
  • Loading branch information
brianriceca committed Oct 3, 2017
1 parent 126edde commit 978e586
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
32 changes: 32 additions & 0 deletions self-paced-labs/cloud-iot-core/labinfra/qwiklabs.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{# Outputs described in this special qwiklabs template will be surfaced #}
{# back up to the student in the Qwiklabs UI, so you can say things like #}
{# 'enter the name of the ExampleBucket we created for you' #}

{# Create whatever cloud deployment magic you want here. #}
{# See go/qwiklabs-deployment-manager for the available properties. #}
resources:
- name: allow-ssh
type: compute.v1.firewall
properties:
network: global/networks/default
sourceRanges: ["0.0.0.0/0"]
allowed:
- IPProtocol: TCP
ports: ["22"]
- name: iot
type: compute.v1.instance
properties:
zone: {{ properties['zone'] }}
machineType: zones/{{ properties['zone'] }}/machineTypes/n1-standard-1
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: projects/debian-cloud/global/images/debian-9-stretch-v20170918
networkInterfaces:
- network: https://www.googleapis.com/compute/v1/projects/{{ env["project"] }}/global/networks/default
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
39 changes: 39 additions & 0 deletions self-paced-labs/cloud-iot-core/labinfra/qwiklabs_test_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
###################################
## Sample Configuration for testing
## Qwiklabs cloud deployments using
## local gcloud tools
##
## Values in here subject to change
## when the environment is launched
## for a given Qwiklabs learner
####################################

imports:
- path: qwiklabs.jinja

# Outputs here for your testing, so you can make
# sure the right values are coming back from
# the deployment. But the values Qwiklabs will
# use are derived directly from the outputs of
# the qwiklabs.jinja template.
#
# These, along with the rest of the file, are
# ignored by Qwiklabs runtime environment
outputs:

# Similarly, this section should only include the
# special 'qwiklabs' resource, properties available
# for your testing, but all dev work should happen
# under the qwiklabs.jinja template
resources:
- name: qwiklabs
type: qwiklabs.jinja
properties:
zone: us-west1-a
region: us-west1
userName: googlestudent
userPassword: googlestudent
sshPubKey: A123412341234
# NOTE: randomize this Uuid if you get namespace
# conflicts when testing (e.g. duplicate bucket name)
qwiklabsUuid: ql-1e433efb3jdfd

0 comments on commit 978e586

Please sign in to comment.