Skip to content

Instantly share code, notes, and snippets.

View jb68's full-sized avatar

Julian Buliga jb68

View GitHub Profile
@pmeulen
pmeulen / snapshot.sh
Last active June 18, 2024 14:53
Script to create and restore snapshots of Azure VMs using azure-cli (az)
#!/usr/bin/env bash
# Script to create and restore snapshots of the OS disk of Azure VMs
# Copyright 2018 SURFnet B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@irvingpop
irvingpop / ssh_key.tf
Last active October 16, 2024 14:01
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"