From 0e974a039bbc1342863a310e957593a1dae90e1b Mon Sep 17 00:00:00 2001 From: Robin Lieb Date: Mon, 1 Jul 2024 21:11:10 +0200 Subject: [PATCH] feat: add variable for availability domain (#16) --- README.md | 1 + compute.tf | 2 +- variables.tf | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6922bb7..ded5c1c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ To help get started quickly with this Terraform module, I have included an examp | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [availability\_domain](#input\_availability\_domain) | The availability domain in which the instance should be created, e.g Uocm:PHX-AD-1. | `string` | n/a | yes | | [fingerprint](#input\_fingerprint) | The fingerprint of the private\_key, e.g. 8c:bf:17:7b:5f:e0:7d:13:75:11:d6:39:0d:e2:84:74. | `string` | n/a | yes | | [private\_key](#input\_private\_key) | The private key retrieved from the Oracle account. | `string` | n/a | yes | | [region](#input\_region) | The desired region of the cluster, e.g. us-phoenix-1. | `string` | n/a | yes | diff --git a/compute.tf b/compute.tf index 2baff95..1ba9ea4 100644 --- a/compute.tf +++ b/compute.tf @@ -1,6 +1,6 @@ resource "oci_core_instance" "ubuntu_instance" { count = var.instance_count - availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name + availability_domain = coalesce(var.availability_domain, data.oci_identity_availability_domains.ads.availability_domains[0].name) compartment_id = oci_identity_compartment.terraform_compartment.id shape = var.instance_shape diff --git a/variables.tf b/variables.tf index b746ab8..1f9b1b4 100644 --- a/variables.tf +++ b/variables.tf @@ -23,6 +23,11 @@ variable "region" { type = string } +variable "availability_domain" { + description = "The availability domain in which the instance should be created, e.g Uocm:PHX-AD-1." + type = string +} + variable "ssh_public_key" { description = "The public key used for SSH to the instances." type = string