-
Notifications
You must be signed in to change notification settings - Fork 12
/
redis_replicas.tf
107 lines (89 loc) · 3.32 KB
/
redis_replicas.tf
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
## Copyright (c) 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
resource "oci_core_instance" "redis4" {
availability_domain = var.availablity_domain_name
fault_domain = "FAULT-DOMAIN-2"
compartment_id = var.compartment_ocid
display_name = "${var.redis-prefix}4"
shape = var.instance_shape
dynamic "shape_config" {
for_each = local.is_flexible_node_shape ? [1] : []
content {
memory_in_gbs = var.instance_flex_shape_memory
ocpus = var.instance_flex_shape_ocpus
}
}
create_vnic_details {
subnet_id = oci_core_subnet.redis-subnet.id
display_name = "primaryvnic"
assign_public_ip = true
hostname_label = "${var.redis-prefix}4"
}
source_details {
source_type = "image"
source_id = data.oci_core_images.InstanceImageOCID.images[0].id
}
metadata = {
ssh_authorized_keys = var.ssh_public_key
user_data = data.template_cloudinit_config.cloud_init.rendered
}
defined_tags = {"${oci_identity_tag_namespace.ArchitectureCenterTagNamespace.name}.${oci_identity_tag.ArchitectureCenterTag.name}" = var.release }
}
resource "oci_core_instance" "redis5" {
availability_domain = var.availablity_domain_name
fault_domain = "FAULT-DOMAIN-2"
compartment_id = var.compartment_ocid
display_name = "${var.redis-prefix}5"
shape = var.instance_shape
dynamic "shape_config" {
for_each = local.is_flexible_node_shape ? [1] : []
content {
memory_in_gbs = var.instance_flex_shape_memory
ocpus = var.instance_flex_shape_ocpus
}
}
create_vnic_details {
subnet_id = oci_core_subnet.redis-subnet.id
display_name = "primaryvnic"
assign_public_ip = true
hostname_label = "${var.redis-prefix}5"
}
source_details {
source_type = "image"
source_id = data.oci_core_images.InstanceImageOCID.images[0].id
}
metadata = {
ssh_authorized_keys = var.ssh_public_key
user_data = data.template_cloudinit_config.cloud_init.rendered
}
defined_tags = {"${oci_identity_tag_namespace.ArchitectureCenterTagNamespace.name}.${oci_identity_tag.ArchitectureCenterTag.name}" = var.release }
}
resource "oci_core_instance" "redis6" {
availability_domain = var.availablity_domain_name
fault_domain = "FAULT-DOMAIN-2"
compartment_id = var.compartment_ocid
display_name = "${var.redis-prefix}6"
shape = var.instance_shape
dynamic "shape_config" {
for_each = local.is_flexible_node_shape ? [1] : []
content {
memory_in_gbs = var.instance_flex_shape_memory
ocpus = var.instance_flex_shape_ocpus
}
}
create_vnic_details {
subnet_id = oci_core_subnet.redis-subnet.id
display_name = "primaryvnic"
assign_public_ip = true
hostname_label = "${var.redis-prefix}6"
}
source_details {
source_type = "image"
source_id = data.oci_core_images.InstanceImageOCID.images[0].id
}
metadata = {
ssh_authorized_keys = var.ssh_public_key
user_data = data.template_cloudinit_config.cloud_init.rendered
}
defined_tags = {"${oci_identity_tag_namespace.ArchitectureCenterTagNamespace.name}.${oci_identity_tag.ArchitectureCenterTag.name}" = var.release }
}