Skip to content
Snippets Groups Projects
Verified Commit db27e3d0 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

terraform/azure: Extract default setup in init.tf

parent 07128ae2
No related branches found
No related tags found
No related merge requests found
......@@ -52,9 +52,6 @@ differential plan:
terraform plan
```
Note: It might be a good idea to change the `variables.tf` file to adapt for
example the admin user and its associated public key
# Apply changes
Same as previous command except that it applies the diff to the infra
......@@ -63,3 +60,12 @@ Same as previous command except that it applies the diff to the infra
```
terraform apply
```
Note: adapt the `init.tf` file with the admin user's associated public key
first. That will allow you to connect (ssh) to the new nodes you created (if
any).
# Arborescence
- init.tf: Common resources in our azure infrastructure
- vault.tf: Vault node definition
# Keyword use:
# - provider: Define the provider(s)
# - data: Retrieve data information to be used within the file
# - resource: Define resource and create/update
# Configure the Microsoft Azure Provider
# Empty if using the `az login` tool
provider "azurerm" {
version = "~> 1.27"
}
# Reuse the network security group as defined currently
data "azurerm_network_security_group" "worker-nsg" {
name = "worker-nsg"
resource_group_name = "swh-resource"
}
# Same for the subnet
data "azurerm_subnet" "default" {
name = "default"
virtual_network_name = "swh-vnet"
resource_group_name = "swh-resource"
}
variable "ssh_key_data" {
type = "string"
default = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZarzgHrzUYspvrgSI6fszrALo92BDys7QOkJgUfZa9t9m4g7dUANNtwBiqIbqijAQPmB1zKgG6QTZC5rJkRy6KqXCW/+Qeedw/FWIbuI7jOD5WxnglbEQgvPkkB8kf1xIF7icRfWcQmK2je/3sFd9yS4/+jftNMPPXkBCxYm74onMenyllA1akA8FLyujLu6MNA1D8iLLXvz6pBDTT4GZ5/bm3vSE6Go8Xbuyu4SCtYZSHaHC2lXZ6Hhi6dbli4d3OwkUWz+YhFGaEra5Fx45Iig4UCL6kXPkvL/oSc9KGerpT//Xj9qz1K7p/IrBS8+eA4X69bHYYV0UZKDADZSn ardumont@bespin"
default = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZarzgHrzUYspvrgSI6fszrALo92BDys7QOkJgUfZa9t9m4g7dUANNtwBiqIbqijAQPmB1zKgG6QTZC5rJkRy6KqXCW/+Qeedw/FWIbuI7jOD5WxnglbEQgvPkkB8kf1xIF7icRfWcQmK2je/3sFd9yS4/+jftNMPPXkBCxYm74onMenyllA1akA8FLyujLu6MNA1D8iLLXvz6pBDTT4GZ5/bm3vSE6Go8Xbuyu4SCtYZSHaHC2lXZ6Hhi6dbli4d3OwkUWz+YhFGaEra5Fx45Iig4UCL6kXPkvL/oSc9KGerpT//Xj9qz1K7p/IrBS8+eA4X69bHYYV0UZKDADZSn ardumont@yavin4"
}
variable "user_admin" {
type = "string"
default = "ardumont"
default = "root"
}
# Keyword use:
# - provider: Define the provider(s)
# - data: Retrieve data information to be used within the file
# - resource: Define resource and create/update
# Configure the Microsoft Azure Provider
# Empty if using the `az login` tool
provider "azurerm" {
version = "~> 1.27"
}
# Reuse the network security group as defined currently
data "azurerm_network_security_group" "worker-nsg" {
name = "worker-nsg"
resource_group_name = "swh-resource"
}
# Same for the subnet
data "azurerm_subnet" "default" {
name = "default"
virtual_network_name = "swh-vnet"
resource_group_name = "swh-resource"
}
# Define a new resource for the vault
# matching what we name elsewhere "euwest-${resource}"
......
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