Skip to content

Commit e430ce2

Browse files
authored
Merge pull request #33 from mattermost/fix/variables_issues
Fix tags variable type.
2 parents 415d03c + 4d18302 commit e430ce2

File tree

11 files changed

+21
-29
lines changed

11 files changed

+21
-29
lines changed

.github/workflows/notify-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11-
- run: make notify
11+
- run: sh ./scripts/notify.sh
1212
env:
1313
GITHUB_CONTEXT: ${{ toJson(github) }}
1414
- uses: mattermost/action-mattermost-notify@1.0.2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ coverage.out
99
.vscode
1010
.idea
1111
build/_output/
12+
terraform/aws/database-factory-postgresql/.terraform.lock.hcl

terraform/aws/database-factory-postgresql/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ No resources.
3636
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the environment which will deploy to and will be added as a tag | `string` | `""` | no |
3737
| <a name="input_final_snapshot_identifier_prefix"></a> [final\_snapshot\_identifier\_prefix](#input\_final\_snapshot\_identifier\_prefix) | The prefix name of your final DB snapshot when this DB instance is deleted | `string` | `"final"` | no |
3838
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | The instance type of the RDS instance | `string` | `""` | no |
39-
| <a name="input_lambda_arn"></a> [lambda\_arn](#input\_lambda\_arn) | Lambda logs-to-opensearch ARN | `string` | `""` | no |
4039
| <a name="input_lambda_name"></a> [lambda\_name](#input\_lambda\_name) | Lambda which ships logs to opensearch | `string` | `"logs-to-opensearch"` | no |
4140
| <a name="input_max_postgresql_connections"></a> [max\_postgresql\_connections](#input\_max\_postgresql\_connections) | n/a | `string` | `""` | no |
42-
| <a name="input_max_postgresql_connections_map"></a> [max\_postgresql\_connections\_map](#input\_max\_postgresql\_connections\_map) | n/a | `map(any)` | <pre>{<br> "db.r5.12xlarge": "40285",<br> "db.r5.16xlarge": "53715",<br> "db.r5.24xlarge": "80575",<br> "db.r5.2xlarge": "6710",<br> "db.r5.4xlarge": "13425",<br> "db.r5.8xlarge": "26855",<br> "db.r5.large": "1675",<br> "db.r5.xlarge": "3355",<br> "db.t3.medium": "415"<br>}</pre> | no |
41+
| <a name="input_max_postgresql_connections_map"></a> [max\_postgresql\_connections\_map](#input\_max\_postgresql\_connections\_map) | n/a | `map(any)` | <pre>{<br> "db.r5.12xlarge": "40285",<br> "db.r5.16xlarge": "53715",<br> "db.r5.24xlarge": "80575",<br> "db.r5.2xlarge": "6710",<br> "db.r5.4xlarge": "13425",<br> "db.r5.8xlarge": "26855",<br> "db.r5.large": "1675",<br> "db.r5.xlarge": "3355",<br> "db.r6g.2xlarge": "6958",<br> "db.r6g.large": "1722",<br> "db.r6g.xlarge": "3479",<br> "db.t3.medium": "415",<br> "db.t3.small": "198"<br>}</pre> | no |
4342
| <a name="input_memory_alarm_limit"></a> [memory\_alarm\_limit](#input\_memory\_alarm\_limit) | Limit to trigger memory alarm. Number in Bytes (100MB) | `string` | `"100000000"` | no |
4443
| <a name="input_memory_cache_proportion"></a> [memory\_cache\_proportion](#input\_memory\_cache\_proportion) | Proportion of memory that is used for cache. By default it is 75%. A change in this variable should be reflected in database factory vertical scaling main.go as well. | `number` | `0.75` | no |
4544
| <a name="input_monitoring_interval"></a> [monitoring\_interval](#input\_monitoring\_interval) | The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance | `number` | `60` | no |
@@ -50,7 +49,7 @@ No resources.
5049
| <a name="input_predefined_metric_type"></a> [predefined\_metric\_type](#input\_predefined\_metric\_type) | A predefined metric type | `string` | `"RDSReaderAverageDatabaseConnections"` | no |
5150
| <a name="input_preferred_backup_window"></a> [preferred\_backup\_window](#input\_preferred\_backup\_window) | The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter | `string` | `"02:00-03:00"` | no |
5251
| <a name="input_preferred_maintenance_window"></a> [preferred\_maintenance\_window](#input\_preferred\_maintenance\_window) | The window to perform maintenance in | `string` | `"sat:09:00-sat:11:00"` | no |
53-
| <a name="input_ram_memory_bytes"></a> [ram\_memory\_bytes](#input\_ram\_memory\_bytes) | The RAM memory of each instance type in Bytes. A change in this variable should be reflected in database factory vertical scaling main.go as well. | `map(any)` | <pre>{<br> "db.r5.12xlarge": "412316860416",<br> "db.r5.16xlarge": "549755813888",<br> "db.r5.24xlarge": "824633720832",<br> "db.r5.2xlarge": "68719476736",<br> "db.r5.4xlarge": "137438953472",<br> "db.r5.8xlarge": "274877906944",<br> "db.r5.large": "17179869184",<br> "db.r5.xlarge": "34359738368",<br> "db.t3.medium": "4294967296"<br>}</pre> | no |
52+
| <a name="input_ram_memory_bytes"></a> [ram\_memory\_bytes](#input\_ram\_memory\_bytes) | The RAM memory of each instance type in Bytes. A change in this variable should be reflected in database factory vertical scaling main.go as well. | `map(any)` | <pre>{<br> "db.r5.12xlarge": "412316860416",<br> "db.r5.16xlarge": "549755813888",<br> "db.r5.24xlarge": "824633720832",<br> "db.r5.2xlarge": "68719476736",<br> "db.r5.4xlarge": "137438953472",<br> "db.r5.8xlarge": "274877906944",<br> "db.r5.large": "17179869184",<br> "db.r5.xlarge": "34359738368",<br> "db.r6g.2xlarge": "68719476736",<br> "db.r6g.large": "17179869184",<br> "db.r6g.xlarge": "34359738368",<br> "db.t3.medium": "4294967296",<br> "db.t3.small": "2147483648"<br>}</pre> | no |
5453
| <a name="input_random_page_cost"></a> [random\_page\_cost](#input\_random\_page\_cost) | Sets the planner's estimate of the cost of a non-sequentially-fetched disk page. The default is 4.0. This value can be overridden for tables and indexes in a particular tablespace by setting the tablespace parameter of the same name. | `number` | `1.1` | no |
5554
| <a name="input_replica_min"></a> [replica\_min](#input\_replica\_min) | Number of replicas to deploy initially with the RDS Cluster. This is managed by the database factory app. | `number` | `3` | no |
5655
| <a name="input_replica_scale_connections"></a> [replica\_scale\_connections](#input\_replica\_scale\_connections) | Needs to be set when predefined\_metric\_type is RDSReaderAverageDatabaseConnections | `number` | `100000` | no |

terraform/aws/database-factory-postgresql/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module "rds_setup" {
2121
db_id = var.db_id
2222
environment = var.environment
2323
port = var.port
24-
name = "mattermost-cloud-${var.environment}-dbfactory"
2524
engine = var.engine
2625
engine_version = var.engine_version
2726
username = var.username
@@ -57,7 +56,6 @@ module "rds_setup" {
5756
tcp_keepalives_interval = var.tcp_keepalives_interval
5857
random_page_cost = var.random_page_cost
5958
multitenant_tag = var.multitenant_tag
60-
lambda_arn = var.lambda_arn
6159
lambda_name = var.lambda_name
6260
cwl_endpoint = var.cwl_endpoint
6361

terraform/aws/database-factory-postgresql/variables.tf

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ variable "max_postgresql_connections" {
186186

187187
variable "max_postgresql_connections_map" {
188188
default = {
189+
"db.t3.small" = "198"
189190
"db.t3.medium" = "415"
191+
"db.t4g.small" = "198"
192+
"db.t4g.medium" = "415"
190193
"db.r5.large" = "1675"
191194
"db.r5.xlarge" = "3355"
192195
"db.r5.2xlarge" = "6710"
@@ -195,13 +198,19 @@ variable "max_postgresql_connections_map" {
195198
"db.r5.12xlarge" = "40285"
196199
"db.r5.16xlarge" = "53715"
197200
"db.r5.24xlarge" = "80575"
201+
"db.r6g.2xlarge" = "6958"
202+
"db.r6g.xlarge" = "3479"
203+
"db.r6g.large" = "1722"
198204
}
199205
type = map(any)
200206
}
201207

202208
variable "ram_memory_bytes" {
203209
default = {
210+
"db.t3.small" = "2147483648"
204211
"db.t3.medium" = "4294967296"
212+
"db.t4g.small" = "2147483648"
213+
"db.t4g.medium" = "4294967296"
205214
"db.r5.large" = "17179869184"
206215
"db.r5.xlarge" = "34359738368"
207216
"db.r5.2xlarge" = "68719476736"
@@ -210,6 +219,9 @@ variable "ram_memory_bytes" {
210219
"db.r5.12xlarge" = "412316860416"
211220
"db.r5.16xlarge" = "549755813888"
212221
"db.r5.24xlarge" = "824633720832"
222+
"db.r6g.large" = "17179869184"
223+
"db.r6g.xlarge" = "34359738368"
224+
"db.r6g.2xlarge" = "68719476736"
213225
}
214226
type = map(any)
215227
description = "The RAM memory of each instance type in Bytes. A change in this variable should be reflected in database factory vertical scaling main.go as well."
@@ -251,12 +263,6 @@ variable "tcp_keepalives_interval" {
251263
type = number
252264
}
253265

254-
variable "lambda_arn" {
255-
default = ""
256-
description = "Lambda logs-to-opensearch ARN"
257-
type = string
258-
}
259-
260266
variable "lambda_name" {
261267
default = "logs-to-opensearch"
262268
description = "Lambda which ships logs to opensearch"

terraform/aws/database-factory/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module "rds_setup" {
2121
db_id = var.db_id
2222
environment = var.environment
2323
port = var.port
24-
name = "mattermost-cloud-${var.environment}-dbfactory"
2524
engine = var.engine
2625
engine_version = var.engine_version
2726
username = var.username

terraform/aws/modules/rds-aurora-postgresql/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ No modules.
5757
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the environment which will deploy to and will be added as a tag | `string` | n/a | yes |
5858
| <a name="input_final_snapshot_identifier_prefix"></a> [final\_snapshot\_identifier\_prefix](#input\_final\_snapshot\_identifier\_prefix) | The prefix name of your final DB snapshot when this DB instance is deleted | `string` | n/a | yes |
5959
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | The instance type of the RDS instance | `string` | n/a | yes |
60-
| <a name="input_lambda_arn"></a> [lambda\_arn](#input\_lambda\_arn) | Lambda logs-to-opensearch ARN | `string` | `""` | no |
6160
| <a name="input_lambda_name"></a> [lambda\_name](#input\_lambda\_name) | Lambda which ships logs to opensearch | `string` | `"logs-to-opensearch"` | no |
6261
| <a name="input_max_postgresql_connections"></a> [max\_postgresql\_connections](#input\_max\_postgresql\_connections) | n/a | `string` | n/a | yes |
6362
| <a name="input_max_postgresql_connections_map"></a> [max\_postgresql\_connections\_map](#input\_max\_postgresql\_connections\_map) | n/a | `map(any)` | n/a | yes |
@@ -82,7 +81,7 @@ No modules.
8281
| <a name="input_replica_scale_out_cooldown"></a> [replica\_scale\_out\_cooldown](#input\_replica\_scale\_out\_cooldown) | Cooldown in seconds before allowing further scaling operations after a scale out | `number` | n/a | yes |
8382
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted | `bool` | n/a | yes |
8483
| <a name="input_storage_encrypted"></a> [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB cluster is encrypted | `bool` | n/a | yes |
85-
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resource | `list(string)` | n/a | yes |
84+
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resource | `map(any)` | n/a | yes |
8685
| <a name="input_tcp_keepalives_count"></a> [tcp\_keepalives\_count](#input\_tcp\_keepalives\_count) | Maximum number of TCP keepalive retransmits.Specifies the number of TCP keepalive messages that can be lost before the server's connection to the client is considered dead. A value of 0 (the default) selects the operating system's default. | `number` | n/a | yes |
8786
| <a name="input_tcp_keepalives_idle"></a> [tcp\_keepalives\_idle](#input\_tcp\_keepalives\_idle) | Time between issuing TCP keepalives.Specifies the amount of time with no network activity after which the operating system should send a TCP keepalive message to the client. If this value is specified without units, it is taken as seconds. A value of 0 (the default) selects the operating system's default. | `number` | n/a | yes |
8887
| <a name="input_tcp_keepalives_interval"></a> [tcp\_keepalives\_interval](#input\_tcp\_keepalives\_interval) | Time between TCP keepalive retransmits. Specifies the amount of time after which a TCP keepalive message that has not been acknowledged by the client should be retransmitted. If this value is specified without units, it is taken as seconds. A value of 0 (the default) selects the operating system's default. | `number` | n/a | yes |

terraform/aws/modules/rds-aurora-postgresql/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,5 @@ resource "aws_cloudwatch_log_subscription_filter" "rds-cluster-cloudwatch-logs-t
293293
name = format("rds-cluster-multitenant-%s-%s-subscription-filter", split("-", var.vpc_id)[1], local.database_id)
294294
log_group_name = format("/aws/rds/cluster/rds-cluster-multitenant-%s-%s/postgresql", split("-", var.vpc_id)[1], local.database_id)
295295
filter_pattern = "[date, time, message]"
296-
destination_arn = var.lambda_arn
296+
destination_arn = "arn:aws:lambda:${local.account_details}:function:${var.lambda_name}"
297297
}

terraform/aws/modules/rds-aurora-postgresql/variables.tf

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ variable "environment" {
1818
type = string
1919
}
2020

21-
//variable "name" {
22-
// description = ""
23-
// type = string
24-
//}
25-
2621
variable "engine" {
2722
description = "The database engine to use"
2823
type = string
@@ -95,7 +90,7 @@ variable "enabled_cloudwatch_logs_exports" {
9590

9691
variable "tags" {
9792
description = "A map of tags to assign to the resource"
98-
type = list(string)
93+
type = map(any)
9994
}
10095

10196
variable "instance_type" {
@@ -201,11 +196,6 @@ variable "multitenant_tag" {
201196
description = "The tag that will be applied and identify the type of multitenant DB cluster(multitenant-rds-dbproxy or multitenant-rds)."
202197
}
203198

204-
variable "lambda_arn" {
205-
default = ""
206-
description = "Lambda logs-to-opensearch ARN"
207-
type = string
208-
}
209199

210200
variable "lambda_name" {
211201
default = "logs-to-opensearch"

terraform/aws/modules/rds-aurora/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ No modules.
6969
| <a name="input_replica_scale_out_cooldown"></a> [replica\_scale\_out\_cooldown](#input\_replica\_scale\_out\_cooldown) | Cooldown in seconds before allowing further scaling operations after a scale out | `number` | n/a | yes |
7070
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted | `bool` | n/a | yes |
7171
| <a name="input_storage_encrypted"></a> [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB cluster is encrypted | `bool` | n/a | yes |
72-
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resource | `list(string)` | n/a | yes |
72+
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resource | `map(any)` | n/a | yes |
7373
| <a name="input_username"></a> [username](#input\_username) | Username for the master DB user | `string` | n/a | yes |
7474
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The VPC ID of the database cluster | `string` | n/a | yes |
7575

0 commit comments

Comments
 (0)