Skip to content
Snippets Groups Projects
Commit 2557dc4c authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

Port to terraform 0.12

parent 456f6a27
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
# Configure the Microsoft Azure Provider
# Empty if using the `az login` tool
provider "azurerm" {
version = "~> 1.27"
version = "~> 1.27"
}
# Reuse the network security group as defined currently
......
......@@ -5,20 +5,20 @@ resource "azurerm_resource_group" "euwest-vault" {
name = "euwest-vault"
location = "westeurope"
tags {
environment = "SWH Vault"
tags = {
environment = "SWH Vault"
}
}
resource "azurerm_network_interface" "vangogh-interface" {
name = "vangogh-interface"
location = "westeurope"
resource_group_name = "euwest-vault"
network_security_group_id = "${data.azurerm_network_security_group.worker-nsg.id}"
name = "vangogh-interface"
location = "westeurope"
resource_group_name = "euwest-vault"
network_security_group_id = data.azurerm_network_security_group.worker-nsg.id
ip_configuration {
name = "vaultNicConfiguration"
subnet_id = "${data.azurerm_subnet.default.id}"
subnet_id = data.azurerm_subnet.default.id
public_ip_address_id = ""
private_ip_address_allocation = "Dynamic"
}
......@@ -27,22 +27,22 @@ resource "azurerm_network_interface" "vangogh-interface" {
# Blobstorage as defined in task
resource "azurerm_storage_account" "vault-storage" {
name = "swhvaultstorage"
resource_group_name = "${azurerm_resource_group.euwest-vault.name}"
resource_group_name = azurerm_resource_group.euwest-vault.name
location = "westeurope"
account_tier = "Standard"
account_replication_type = "LRS"
account_kind = "BlobStorage"
access_tier = "Cool"
tags {
environment = "SWH Vault"
tags = {
environment = "SWH Vault"
}
}
# A container for the blob storage named 'contents' (as other blob storages)
resource "azurerm_storage_container" "contents" {
name = "contents"
resource_group_name = "${azurerm_resource_group.euwest-vault.name}"
storage_account_name = "${azurerm_storage_account.vault-storage.name}"
resource_group_name = azurerm_resource_group.euwest-vault.name
storage_account_name = azurerm_storage_account.vault-storage.name
container_access_type = "private"
}
......@@ -50,7 +50,7 @@ resource "azurerm_virtual_machine" "vault-server" {
name = "vangogh"
location = "westeurope"
resource_group_name = "euwest-vault"
network_interface_ids = ["${azurerm_network_interface.vangogh-interface.id}"]
network_interface_ids = [azurerm_network_interface.vangogh-interface.id]
vm_size = "Standard_B2ms"
storage_os_disk {
......@@ -70,18 +70,19 @@ resource "azurerm_virtual_machine" "vault-server" {
# (Va)ngogh <-> (Va)ult
os_profile {
computer_name = "vangogh"
admin_username = "${var.user_admin}"
admin_username = "ardumont"
}
os_profile_linux_config {
disable_password_authentication = true
ssh_keys {
path = "/home/${var.user_admin}/.ssh/authorized_keys"
key_data = "${var.ssh_key_data}"
path = "/home/${var.user_admin}/.ssh/authorized_keys"
key_data = var.ssh_key_data
}
}
tags {
environment = "SWH Vault"
tags = {
environment = "SWH Vault"
}
}
terraform {
required_version = ">= 0.12"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment