-
Notifications
You must be signed in to change notification settings - Fork 2
Update Terraform advanced example #2
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
4c0de62
e87d29a
cad0c02
5cb10a5
8a95375
4c6bea8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,24 +4,37 @@ provider "sys11dbaas" { | |
| organization = var.org | ||
| } | ||
|
|
||
| resource "sys11dbaas_database" "db" { | ||
| resource "sys11dbaas_database_v2" "db" { | ||
| name = var.db_name | ||
| description = var.db_description | ||
| application_config = { | ||
| instances = var.db_instances | ||
| password = var.db_password | ||
| type = var.db_type | ||
| version = var.db_version | ||
|
|
||
| private_networking = { | ||
| enabled = var.private_networking | ||
| shared_subnet_cidr = var.shared_subnet_cidr | ||
| allowed_cidrs = var.db_remote_ips | ||
| } | ||
|
|
||
| public_networking = { | ||
| enabled = var.public_networking | ||
| allowed_cidrs = var.db_remote_ips | ||
frittenlab marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| scheduled_backups = { | ||
| schedule = { | ||
| hour = var.db_backup_hour | ||
| } | ||
| } | ||
| } | ||
|
|
||
| service_config = { | ||
| disksize = var.db_disk_size | ||
| flavor = var.db_flavor | ||
| region = var.region | ||
| remote_ips = var.db_remote_ips | ||
| disksize = var.db_disk_size | ||
| flavor = var.db_flavor | ||
| region = var.region | ||
| remote_ips = var.db_remote_ips | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you test this? 🤔 I think |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,19 @@ | ||
| output "db" { | ||
| value = [resource.sys11dbaas_database.db.uuid, resource.sys11dbaas_database.db.status, resource.sys11dbaas_database.db.phase, resource.sys11dbaas_database.db.resource_status] | ||
| output "db-hostname" { | ||
| value = resource.sys11dbaas_database_v2.db.application_config.private_networking.hostname | ||
| } | ||
|
|
||
| output "db-uuid" { | ||
| value = resource.sys11dbaas_database_v2.db.uuid | ||
| } | ||
|
|
||
| output "db-status" { | ||
| value = resource.sys11dbaas_database_v2.db.status | ||
| } | ||
|
|
||
| output "subnet-id" { | ||
| value = resource.sys11dbaas_database_v2.db.application_config.private_networking.shared_subnet_id | ||
| } | ||
|
|
||
| output "network-id" { | ||
| value = resource.sys11dbaas_database_v2.db.application_config.private_networking.shared_network_id | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -72,7 +72,22 @@ variable "db_backup_hour" { | |||||
| default = 4 | ||||||
| } | ||||||
|
|
||||||
| variable "private_networking" { | ||||||
| type = bool | ||||||
| default = true | ||||||
| } | ||||||
|
|
||||||
| variable "public_networking" { | ||||||
| type = bool | ||||||
| default = false | ||||||
| } | ||||||
|
|
||||||
| variable "shared_subnet_cidr" { | ||||||
| type = string | ||||||
| default = "10.245.0.0/24" | ||||||
| } | ||||||
|
|
||||||
| variable "db_remote_ips" { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| type = list(string) | ||||||
| default = ["0.0.0.0/0"] | ||||||
| default = ["10.245.0.0/24"] | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ terraform { | |||||
| required_providers { | ||||||
| sys11dbaas = { | ||||||
| source = "registry.terraform.io/syseleven/sys11dbaas" | ||||||
| version = ">= 0.2.0" | ||||||
| version = ">= 0.3.0" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
| } | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.