Skip to content

Commit

Permalink
Merge pull request #6 from FlexibleEngineCloud/osa_paramgroup
Browse files Browse the repository at this point in the history
Osa paramgroup
  • Loading branch information
osaluden authored Dec 22, 2020
2 parents e4af47a + e68aa89 commit 51c30a0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ More details about supported version in followed link https://registry.terraform
```hcl
module "rds" {
source = "FlexibleEngineCloud/rds/flexibleengine"
version = "1.0.0"
version = "2.1.5"
vpc_name = "vpc-main"
subnet_name = "subnet-cce"
db_type = "MySQL"
Expand All @@ -44,8 +44,8 @@ module "rds" {
### Terragrunt Configuration ###
################################
terraform {
source = "terraform-flexibleengine-modules/rds/flexibleengine"
version = "1.0.0"
source = "FlexibleEngineCloud/rds/flexibleengine"
version = "2.1.5"
}
include {
path = find_in_parent_folders()
Expand Down Expand Up @@ -100,7 +100,7 @@ Refer to [the FE RDS Documentation](https://docs.prod-cloud-ocb.orange-business.
| rds\_instance\_volume\_encryption\_id | KMS Key id for encryption | `string` | `null` | no |
| rds\_instance\_volume\_size | Volume size of instances | `number` | `0` | no |
| rds\_instance\_volume\_type | Volume type of instances | `string` | `"COMMON"` | no |
| rds\_param\_group\_id | Parameters Group ID | `string` | `null` | no |
| rds\_parametergroup\_values | Map of the values of the parameter group | `map(string)` | `{}` | no |
| rds\_read\_replicat\_list | n/a | <pre>list(object({<br> name = string<br> flavor = string<br> availability_zone = string<br> volume_type = string<br> disk_encryption_id = string<br> }))</pre> | n/a | yes |
| subnet\_id | ID of the subnet | `string` | `""` | no |
| vpc\_id | ID of the VPC | `string` | `null` | no |
Expand Down
24 changes: 7 additions & 17 deletions examples/parameter-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,9 @@ module "rds_sg" {
]
}

resource "flexibleengine_rds_parametergroup_v3" "rds_parametergroup" {
name = "mysql-rds-test-pg"
description = "Set time_zone parameter of RDS"
values = {
time_zone = "Europe/Paris"
lower_case_table_names = "0"
}
datastore {
type = "mysql"
version = "5.6"
}
}

module "rds" {
source = "terraform-flexibleengine-modules/rds/flexibleengine"
version = "1.0.0"
source = "FlexibleEngineCloud/rds/flexibleengine"
version = "2.1.5"

vpc_name = "vpc-main"
subnet_name = "subnet-cce"
Expand All @@ -53,8 +40,11 @@ module "rds" {
rds_instance_volume_size = 100
rds_instance_az = ["eu-west-0a"]

rds_param_group_id = flexibleengine_rds_parametergroup_v3.rds_parametergroup.id
rds_parametergroup_values = {
time_zone = "Europe/Paris"
lower_case_table_names = "0"
}

depends_on = [module.rds_sg, flexibleengine_rds_parametergroup_v3.rds_parametergroup]
depends_on = [module.rds_sg]

}
12 changes: 11 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
resource "flexibleengine_rds_parametergroup_v3" "parametergroup" {
count = length(var.rds_parametergroup_values) > 0 ? 1 : 0
name = "parametergroup-${var.rds_instance_name}"
description = "RDS Parameter Group"
values = var.rds_parametergroup_values
datastore {
type = var.db_type
version = var.db_version
}
}
resource "flexibleengine_rds_instance_v3" "instance" {
availability_zone = var.rds_instance_az
db {
Expand All @@ -22,7 +32,7 @@ resource "flexibleengine_rds_instance_v3" "instance" {
keep_days = var.db_backup_keepdays
}

param_group_id = var.rds_param_group_id
param_group_id = length(var.rds_parametergroup_values) > 0 ? flexibleengine_rds_parametergroup_v3.parametergroup.*.id[0] : null
}

resource "flexibleengine_rds_read_replica_v3" "instances" {
Expand Down
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ variable "rds_read_replicat_list" {
}))
}

variable "rds_param_group_id" {
description = "Parameters Group ID"
default = null
type = string
}
variable "rds_parametergroup_values" {
description = "Map of the values of the parameter group"
type = map(string)
default = {}
}

0 comments on commit 51c30a0

Please sign in to comment.