Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Wksctl
Commits
82a62c83
Unverified
Commit
82a62c83
authored
5 years ago
by
Mahmoud Saada
Committed by
GitHub
5 years ago
Browse files
Options
Download
Plain Diff
Merge branch 'master' into add-rhel-support
parents
05f26660
3a6f2ed2
update-docs-bits
WKP-468-verify-log-level
actuator-debug-mode
ignore_vfsdata
0.8.2-beta.1
v0.8.2-beta.4
v0.8.2-beta.3
v0.8.2-beta.2
v0.8.2-beta.1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/integration/bin/internal/provisioning/gcp/main.tf
+18
-0
test/integration/bin/internal/provisioning/gcp/main.tf
with
18 additions
and
0 deletions
+18
-0
test/integration/bin/internal/provisioning/gcp/main.tf
+
18
-
0
View file @
82a62c83
...
...
@@ -44,6 +44,24 @@ resource "google_compute_instance" "tf_test_vm" {
ssh
-
keys
=
"
${
var
.
gcp_username
}
:
${
file
(
"
${
var
.
gcp_public_key_path
}
"
)
}
"
}
# self destruct after 48h hours to cut down costs
# this is a fallback in case preemptible is disabled or doesn't occur
# reference: https://cloud.google.com/community/tutorials/create-a-self-deleting-virtual-machine
metadata_startup_script
=
<<-
EOT
#!/bin/sh
sleep 48h
export NAME=$(curl -X GET http://metadata.google.internal/computeMetadata/v1/instance/name -H 'Metadata-Flavor: Google')
export ZONE=$(curl -X GET http://metadata.google.internal/computeMetadata/v1/instance/zone -H 'Metadata-Flavor: Google')
gcloud --quiet compute instances delete $NAME --zone=$ZONE
EOT
# make the VM preemptible to cut down costs
# and prevent VM from being restarted after preemption
scheduling
{
preemptible
=
true
automatic_restart
=
false
}
# Wait for machine to be SSH-able:
provisioner
"remote-exec"
{
inline
=
[
"exit"
]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help