Skip to content

Instantly share code, notes, and snippets.

View rohrerb's full-sized avatar

Brandon Rohrer rohrerb

View GitHub Profile
2019/08/21 20:16:31 [INFO] Terraform version: 0.12.6
2019/08/21 20:16:31 [INFO] Go runtime version: go1.12.4
2019/08/21 20:16:31 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/1.0.1/versions/0.12.6/terraform", "apply"}
2019/08/21 20:16:31 [DEBUG] Attempting to open CLI config file: /Users/brohrer/.terraformrc
2019/08/21 20:16:31 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/08/21 20:16:31 [INFO] CLI command args: []string{"apply"}
2019/08/21 20:16:31 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/08/21 20:16:31 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/08/21 20:16:31 [DEBUG] New state was assigned lineage "b22c5f72-64db-34de-cbad-d4b6f570725e"
2019/08/21 20:16:31 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
@rohrerb
rohrerb / main.tf
Created August 7, 2019 13:19
Simple resource group module.
module "rgs" {
source = "./modules/resource_group"
names = ["rg-0","rg-1","rg-2"]
azure_location = "eastus"
}
#cloud-config
package_upgrade: false
packages:
- epel-release
- nginx
runcmd:
- systemctl nginx restart
variable "environment_code" { default = "US"}
variable "deployment_code" { default = "T"}
variable "location_code" { default = "V"}
variable "instance_count" { default = 1}
//variable "enable_msi" { default = false}
variable "msi_block_identity" {
type = "map"
default = {
"type" = "SystemAssigned"
locals {
base_hostname = "${format("%s%s%s%s%s", var.environment_code, var.deployment_code, var.location_code, var.os_code, var.instance_type)}"
msi_principal_ids = ["${azurerm_virtual_machine.vm.*.identity.0.principal_id}"]
}
data "azurerm_subscription" "current" {}
resource "azurerm_public_ip" "vm_pip" {
count = "${var.pip_count}"
@rohrerb
rohrerb / main.tf
Last active August 20, 2018 15:36
variable "environment_code" { default = "US"}
variable "deployment_code" { default = "T"}
variable "location_code" { default = "V"}
variable "instance_count" { default = 1}
variable "data_disk_count" { default = 0}
variable "data_disk_size" { default = 1}
locals {
base_hostname = "${format("%s%s%s%s%s", var.environment_code, var.deployment_code, var.location_code, "l", "xyz")}"
}
module "x11x" {
source = "module/linux"
environment_code = "t"
deployment_code = "us1"
location_code = "e11"
instance_count = 1
data_disk_count = 1
data_disk_size = 5
vm_code = "x11x"
variable "environment_code" { default = "US"}
variable "deployment_code" { default = "A"}
variable "location_code" { default = "V"}
variable "instance_count" { default = 1}
variable "data_disk_count" { default = 0}
variable "data_disk_size" { default = 0}
locals {
base_hostname = "${format("%s%s%s%s%s", var.environment_code, var.deployment_code, var.location_code, "l", "xyz")}"
}
variable "environment_code" { default = "US"}
variable "deployment_code" { default = "T"}
variable "location_code" { default = "V"}
variable "instance_count" { default = 2}
variable "data_disk_count" { default = 1}
variable "data_disk_size" { default = 1}
locals {
base_hostname = "${format("%s%s%s%s%s", var.environment_code, var.deployment_code, var.location_code, "l", "xyz")}"
}
#! /bin/bash
rg="USTV-Web"
avSetName="myAvSet"
targetsize="Standard_DS2"
avSetDetail=$(az vm availability-set show -g $rg -n $avSetName)
vms=$(echo $avSetDetail | jq '.virtualMachines[]')
avVMIDs=$(echo $vms | jq -r '.id')