Skip to content

chore: Adds Cluster Module Option1 #3501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions examples/modules/option1-full-expose/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


resource "mongodbatlas_advanced_cluster" "this" {
accept_data_risks_and_force_replica_set_reconfig = var.accept_data_risks_and_force_replica_set_reconfig
advanced_configuration = var.advanced_configuration
backup_enabled = var.backup_enabled
bi_connector_config = var.bi_connector_config
cluster_type = var.cluster_type
config_server_management_mode = var.config_server_management_mode
delete_on_create_timeout = var.delete_on_create_timeout
disk_size_gb = var.disk_size_gb
encryption_at_rest_provider = var.encryption_at_rest_provider
global_cluster_self_managed_sharding = var.global_cluster_self_managed_sharding
labels = var.labels
mongo_db_major_version = var.mongo_db_major_version
name = var.name
paused = var.paused
pinned_fcv = var.pinned_fcv
pit_enabled = var.pit_enabled
project_id = var.project_id
redact_client_log_data = var.redact_client_log_data
replica_set_scaling_strategy = var.replica_set_scaling_strategy
replication_specs = var.replication_specs
retain_backups_enabled = var.retain_backups_enabled
root_cert_type = var.root_cert_type
tags = var.tags
termination_protection_enabled = var.termination_protection_enabled
timeouts = var.timeouts
version_release_system = var.version_release_system
}

29 changes: 29 additions & 0 deletions examples/modules/option1-full-expose/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

output "cluster_id" {
value = mongodbatlas_advanced_cluster.this.cluster_id
}


output "config_server_type" {
value = mongodbatlas_advanced_cluster.this.config_server_type
}


output "connection_strings" {
value = mongodbatlas_advanced_cluster.this.connection_strings
}


output "create_date" {
value = mongodbatlas_advanced_cluster.this.create_date
}


output "mongo_db_version" {
value = mongodbatlas_advanced_cluster.this.mongo_db_version
}


output "state_name" {
value = mongodbatlas_advanced_cluster.this.state_name
}
11 changes: 11 additions & 0 deletions examples/modules/option1-full-expose/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

terraform {
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "~> 1.26"
}
}
required_version = ">= 1.8"
}

216 changes: 216 additions & 0 deletions examples/modules/option1-full-expose/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
variable "accept_data_risks_and_force_replica_set_reconfig" {
type = string
nullable = true
default = null
}

variable "advanced_configuration" {
type = object({
change_stream_options_pre_and_post_images_expire_after_seconds = optional(number)
custom_openssl_cipher_config_tls12 = optional(list(string))
default_max_time_ms = optional(number)
default_read_concern = optional(string)
default_write_concern = optional(string)
fail_index_key_too_long = optional(bool)
javascript_enabled = optional(bool)
minimum_enabled_tls_protocol = optional(string)
no_table_scan = optional(bool)
oplog_min_retention_hours = optional(number)
oplog_size_mb = optional(number)
sample_refresh_interval_bi_connector = optional(number)
sample_size_bi_connector = optional(number)
tls_cipher_config_mode = optional(string)
transaction_lifetime_limit_seconds = optional(number)
})
nullable = true
default = null
}

variable "backup_enabled" {
type = bool
nullable = true
default = null
}

variable "bi_connector_config" {
type = object({
enabled = optional(bool)
read_preference = optional(string)
})
nullable = true
default = null
}

variable "cluster_type" {
type = string
}

variable "config_server_management_mode" {
type = string
nullable = true
default = null
}

variable "delete_on_create_timeout" {
type = bool
nullable = true
default = null
}

variable "disk_size_gb" {
type = number
nullable = true
default = null
}

variable "encryption_at_rest_provider" {
type = string
nullable = true
default = null
}

variable "global_cluster_self_managed_sharding" {
type = bool
nullable = true
default = null
}

variable "labels" {
type = map(any)
nullable = true
default = null
}

variable "mongo_db_major_version" {
type = string
nullable = true
default = null
}

variable "name" {
type = string
}

variable "paused" {
type = bool
nullable = true
default = null
}

variable "pinned_fcv" {
type = object({
expiration_date = optional(string)
})
nullable = true
default = null
}

variable "pit_enabled" {
type = bool
nullable = true
default = null
}

variable "project_id" {
type = string
}

variable "redact_client_log_data" {
type = bool
nullable = true
default = null
}

variable "replica_set_scaling_strategy" {
type = string
nullable = true
default = null
}

variable "replication_specs" {
type = list(object({
num_shards = optional(number)
region_configs = optional(list(object({
analytics_auto_scaling = optional(object({
compute_enabled = optional(bool)
compute_max_instance_size = optional(string)
compute_min_instance_size = optional(string)
compute_scale_down_enabled = optional(bool)
disk_gb_enabled = optional(bool)
}))
analytics_specs = optional(object({
disk_iops = optional(number)
disk_size_gb = optional(number)
ebs_volume_type = optional(string)
instance_size = optional(string)
node_count = optional(number)
}))
auto_scaling = optional(object({
compute_enabled = optional(bool)
compute_max_instance_size = optional(string)
compute_min_instance_size = optional(string)
compute_scale_down_enabled = optional(bool)
disk_gb_enabled = optional(bool)
}))
backing_provider_name = optional(string)
electable_specs = optional(object({
disk_iops = optional(number)
disk_size_gb = optional(number)
ebs_volume_type = optional(string)
instance_size = optional(string)
node_count = optional(number)
}))
priority = optional(number)
provider_name = optional(string)
read_only_specs = optional(object({
disk_iops = optional(number)
disk_size_gb = optional(number)
ebs_volume_type = optional(string)
instance_size = optional(string)
node_count = optional(number)
}))
region_name = optional(string)
})))
zone_name = optional(string)
}))
}

variable "retain_backups_enabled" {
type = bool
nullable = true
default = null
}

variable "root_cert_type" {
type = string
nullable = true
default = null
}

variable "tags" {
type = map(any)
nullable = true
default = null
}

variable "termination_protection_enabled" {
type = bool
nullable = true
default = null
}

variable "timeouts" {
type = object({
create = optional(string)
delete = optional(string)
update = optional(string)
})
nullable = true
default = null
}

variable "version_release_system" {
type = string
nullable = true
default = null
}
19 changes: 19 additions & 0 deletions examples/modules/option1-full-expose/vars.example.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

backup_enabled = true
replication_specs = [{
region_configs = [{
provider_name = "AWS",
region_name = "EU_WEST_1",
priority = 7,
electable_specs = {
node_count = 3
instance_size = "M10"
disk_size_gb = 10
}
}]
}]

project_id = "664619d870c247237f4b86a6"
name = "created-from-option1-module"
cluster_type = "REPLICASET"

Loading