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
az_list(){ | |
az account list --output table | |
} | |
az_sub(){ | |
if [ "$1" = "" ] | |
then | |
echo "Usage: az_sub <subscription-id>" | |
return 1 | |
fi |
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
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
C:/ProgramData/chocolatey/choco install git -y | |
# Create myfile: | |
${var1} | Set-Content 'myfile.txt' |
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
data "template_file" "windows_script" { | |
template = "${file("${path.module}/templates/windows_script.ps1")}" | |
vars { | |
var1 = "${var.var1}" | |
} | |
} | |
resource "aws_instance" "myinstance" { | |
connection { | |
type = "winrm" |
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
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
C:/ProgramData/chocolatey/choco install git -y |
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
$ips = $args[0] | |
Foreach ($ip in $ips) { | |
$Username = '{0}\Administrator' -f $ip | |
$Password = '${password}' | |
$pass = ConvertTo-SecureString -AsPlainText $Password -Force | |
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass | |
Set-Item wsman:\localhost\client\trustedhosts $ip -Confirm:$false -Force | |
Invoke-Command -ComputerName $ip -ScriptBlock { Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) } -credential $Cred |
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
data "template_file" "windows_script" { | |
template = "${file("${path.module}/templates/windows_script.ps1")}" | |
vars { | |
password = "${var.windows_password}" | |
} | |
} | |
resource "aws_instance" "myinstance" {} | |
resource "null_resource" "provision" { |
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
data "template_file" "lnx_script" { | |
template = "${file("${path.module}/templates/lnx_script.sh")}" | |
vars { | |
var1 = "${var.var1}" | |
} | |
} | |
resource "aws_instance" "myinstance" { | |
connection { | |
type = "ssh" |
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
data "template_file" "windows_script" { | |
template = "${file("${path.module}/templates/windows_script.ps1")}" | |
vars { | |
var1 = "${var.var1}" | |
} | |
} | |
resource "aws_instance" "myinstance" { | |
connection { | |
type = "winrm" |
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
resource "aws_instance" "myinstance" { | |
connection { | |
user = "${var.user}" | |
private_key = "${file("${var.key_pair_file}")}" | |
bastion_host = "${var.bastion_host}" | |
bastion_user = "${var.bastion_user}" | |
bastion_private_key = "${file("${var.bastion_key_pair_file}")}" | |
} |