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
2018/03/17 16:34:20 [INFO] Terraform version: 0.11.4 7878d66b386e5474102b5047722c2de2b3237278 | |
2018/03/17 16:34:20 [INFO] Go runtime version: go1.10 | |
2018/03/17 16:34:20 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/0.6.0/versions/0.11.4/terraform", "apply", "--auto-approve"} | |
2018/03/17 16:34:20 [DEBUG] Attempting to open CLI config file: /Users/REDACTED/.terraformrc | |
2018/03/17 16:34:20 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2018/03/17 16:34:20 [INFO] CLI command args: []string{"apply", "--auto-approve"} | |
2018/03/17 16:34:20 [INFO] command: empty terraform config, returning nil | |
2018/03/17 16:34:20 [DEBUG] command: no data state file found for backend config | |
2018/03/17 16:34:20 [DEBUG] New state was assigned lineage "a2f5e219-9ab1-393f-192e-0e4c8efe354d" | |
2018/03/17 16:34:20 [INFO] command: backend initialized: <nil> |
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 "azurerm_subscription" "primary" {} | |
resource "random_string" "password" { | |
length = 32 | |
special = true | |
} | |
locals { | |
spn_name = "tfexample" | |
spn_expire = "2020-01-01T00:00:00Z" |
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 "azurerm_virtual_machine" "myvm" { | |
name = "myvm0" | |
resource_group_name = "my-rg" | |
vm_size = "Standard_A2_v2" | |
location = "centralus" | |
network_interface_ids = ["${azurerm_network_interface.myvm.id}"] | |
storage_image_reference { | |
publisher = "MicrosoftWindowsServer" | |
offer = "WindowsServer" |
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
variable "data_disks" { | |
default = [ | |
{ | |
lun = 0 | |
size = 32 | |
}, | |
{ | |
lun = 1 | |
size = 128 | |
}, |
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 "azurerm_virtual_machine" "main" { | |
name = "myvm0" | |
...Some fields omitted... | |
dynamic "storage_data_disk" { | |
for_each = var.data_disks | |
content { | |
name = "datadisk${storage_data_disk.value.lun}" |
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
dynamic "storage_data_disk" { | |
for_each = var.data_disks | |
content { | |
name = "datadisk${storage_data_disk.value.lun}" | |
lun = storage_data_disk.value.lun | |
disk_size_gb = storage_data_disk.value.size | |
create_option = "Empty" | |
managed_disk_type = "Standard_LRS" | |
} |
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
storage_data_disk { | |
name = "datadisk0" | |
lun = 0 | |
disk_size_gb = 32 | |
create_option = "Empty" | |
managed_disk_type = "Standard_LRS" | |
} | |
storage_data_disk { | |
name = "datadisk1" | |
lun = 1 |
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 "azurerm_resource_group" "main" { | |
name = "cardinal-rg" | |
location = "centralus" | |
} | |
resource "azurerm_management_lock" "resource-group-level" { | |
name = "resource-group-level" | |
scope = "${azurerm_resource_group.main.id}" | |
lock_level = "ReadOnly" | |
notes = "This Resource Group is Read-Only" |
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
locals { | |
tfe_application_name = "tfe" | |
tfe_application_url = "https://tfe.company.com" | |
spn_url = "https://some_url.com" | |
tfe_teams = [ | |
"app1-team-dev", | |
"app1-team-admin", | |
"app2-team-dev", | |
"app3-team-admin", |
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 "random_pet" "name" { | |
length = 3 | |
separator = "" | |
} | |
resource "azurerm_resource_group" "example" { | |
name = random_pet.name.id | |
location = "centralus" | |
} |