-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmain.tf
More file actions
60 lines (52 loc) · 1.84 KB
/
main.tf
File metadata and controls
60 lines (52 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# https://github.com/hashicorp/terraform-provider-azurerm/releases
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=4.9.0"
}
}
}
locals {
database_server_type = lower(var.shape) == "exadata.x11m" && var.database_server_type == null ? "X11M" : var.database_server_type
storage_server_type = lower(var.shape) == "exadata.x11m" && var.storage_server_type == null ? "X11M-HC" : var.storage_server_type
}
resource "azurerm_oracle_exadata_infrastructure" "this" {
# Required
resource_group_name = var.resource_group_name
location = var.location
zones = [var.zone]
name = var.name
display_name = var.name
shape = var.shape
compute_count = var.compute_count
storage_count = var.storage_count
database_server_type = local.database_server_type
storage_server_type = local.storage_server_type
# Optional
customer_contacts = var.customer_contacts
tags = var.tags
maintenance_window {
patching_mode = var.maintenance_window.patching_mode
preference = var.maintenance_window.preference
lead_time_in_weeks = coalesce(var.maintenance_window.lead_time_in_weeks,1)
months = coalesce(var.maintenance_window.months,[])
weeks_of_month = coalesce(var.maintenance_window.weeks_of_month,[])
days_of_week = coalesce(var.maintenance_window.days_of_week,[])
hours_of_day = coalesce(var.maintenance_window.hours_of_day,[])
}
lifecycle {
ignore_changes = [
# Updatable from OCI
compute_count,
storage_count,
customer_contacts,
maintenance_window
]
}
}
data "azurerm_oracle_exadata_infrastructure" "this" {
name = var.name
resource_group_name = var.resource_group_name
depends_on = [azurerm_oracle_exadata_infrastructure.this]
}