Skip to content

Commit

Permalink
feat(enable_http_endpoint): added new enable_http_endpoint option for…
Browse files Browse the repository at this point in the history
… aurora serverless engine (#69)

* feat(enable_http_endpoint): added new option
for aurora serverless

related to: #54 #51

* feat(enable_http_endpoint): corrected default value
in docs

related to: #54 #51

* feat: reverted back README.md changes

* feat: reverted back README.md changes

* feat: generated README.md
  • Loading branch information
mariocoski authored Jun 14, 2020
1 parent 7a8c706 commit 995df78
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 51 deletions.
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,24 @@ module "rds_cluster_aurora_postgres" {

```hcl
module "rds_cluster_aurora_mysql_serverless" {
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = "0"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "3306"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = "0"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "3306"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
enable_http_endpoint = true
scaling_configuration = [
{
Expand Down Expand Up @@ -309,6 +310,7 @@ Available targets:
| db_port | Database port | number | `3306` | no |
| deletion_protection | If the DB instance should have deletion protection enabled | bool | `false` | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
| enable_http_endpoint | Enable HTTP endpoint (data API). Only valid when engine_mode is set to serverless | bool | `false` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| enabled_cloudwatch_logs_exports | List of log types to export to cloudwatch. The following log types are supported: audit, error, general, slowquery | list(string) | `<list>` | no |
| engine | The name of the database engine to be used for this DB cluster. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql` | string | `aurora` | no |
Expand Down
35 changes: 18 additions & 17 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,24 @@ usage: |2-
```hcl
module "rds_cluster_aurora_mysql_serverless" {
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = "0"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "3306"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = "0"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "3306"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
enable_http_endpoint = true
scaling_configuration = [
{
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
| db_port | Database port | number | `3306` | no |
| deletion_protection | If the DB instance should have deletion protection enabled | bool | `false` | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
| enable_http_endpoint | Enable HTTP endpoint (data API). Only valid when engine_mode is set to serverless | bool | `false` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| enabled_cloudwatch_logs_exports | List of log types to export to cloudwatch. The following log types are supported: audit, error, general, slowquery | list(string) | `<list>` | no |
| engine | The name of the database engine to be used for this DB cluster. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql` | string | `aurora` | no |
Expand Down
35 changes: 18 additions & 17 deletions examples/serverless_mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@ provider "aws" {
}

module "rds_cluster_aurora_mysql_serverless" {
source = "../../"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = "0"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "3306"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
source = "../../"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = "0"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "3306"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
enable_http_endpoint = true

scaling_configuration = [
{
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ resource "aws_rds_cluster" "default" {
global_cluster_identifier = var.global_cluster_identifier
iam_roles = var.iam_roles
backtrack_window = var.backtrack_window
enable_http_endpoint = var.engine_mode == "serverless" && var.enable_http_endpoint ? true : false

dynamic "scaling_configuration" {
for_each = var.scaling_configuration
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ variable "backtrack_window" {
default = 0
}

variable "enable_http_endpoint" {
type = bool
description = "Enable HTTP endpoint (data API). Only valid when engine_mode is set to serverless"
default = false
}

variable "vpc_security_group_ids" {
type = list(string)
description = "Additional security group IDs to apply to the cluster, in addition to the provisioned default security group with ingress traffic from existing CIDR blocks and existing security groups"
Expand Down

0 comments on commit 995df78

Please sign in to comment.