Skip to content

Commit 2795d5a

Browse files
rafstefbryantbiggs
andauthored
feat: Add support for custom iam instance profile (#473)
Co-authored-by: Bryant Biggs <[email protected]>
1 parent 3baca56 commit 2795d5a

File tree

7 files changed

+16
-1
lines changed

7 files changed

+16
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.77.0
3+
rev: v1.77.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ Users have the ability to:
258258
| <a name="input_create_db_subnet_group"></a> [create\_db\_subnet\_group](#input\_create\_db\_subnet\_group) | Whether to create a database subnet group | `bool` | `false` | no |
259259
| <a name="input_create_monitoring_role"></a> [create\_monitoring\_role](#input\_create\_monitoring\_role) | Create IAM role with a defined name that permits RDS to send enhanced monitoring metrics to CloudWatch Logs | `bool` | `false` | no |
260260
| <a name="input_create_random_password"></a> [create\_random\_password](#input\_create\_random\_password) | Whether to create random password for RDS primary cluster | `bool` | `true` | no |
261+
| <a name="input_custom_iam_instance_profile"></a> [custom\_iam\_instance\_profile](#input\_custom\_iam\_instance\_profile) | RDS custom iam instance profile | `string` | `null` | no |
261262
| <a name="input_db_instance_tags"></a> [db\_instance\_tags](#input\_db\_instance\_tags) | Additional tags for the DB instance | `map(string)` | `{}` | no |
262263
| <a name="input_db_name"></a> [db\_name](#input\_db\_name) | The DB name to create. If omitted, no database is created initially | `string` | `null` | no |
263264
| <a name="input_db_option_group_tags"></a> [db\_option\_group\_tags](#input\_db\_option\_group\_tags) | Additional tags for the DB option group | `map(string)` | `{}` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ module "db_instance" {
8989
domain = var.domain
9090
domain_iam_role_name = var.domain_iam_role_name
9191
iam_database_authentication_enabled = var.iam_database_authentication_enabled
92+
custom_iam_instance_profile = var.custom_iam_instance_profile
9293

9394
vpc_security_group_ids = var.vpc_security_group_ids
9495
db_subnet_group_name = local.db_subnet_group_name

modules/db_instance/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ No modules.
5252
| <a name="input_create"></a> [create](#input\_create) | Whether to create this resource or not? | `bool` | `true` | no |
5353
| <a name="input_create_cloudwatch_log_group"></a> [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group) | Determines whether a CloudWatch log group is created for each `enabled_cloudwatch_logs_exports` | `bool` | `false` | no |
5454
| <a name="input_create_monitoring_role"></a> [create\_monitoring\_role](#input\_create\_monitoring\_role) | Create IAM role with a defined name that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. | `bool` | `false` | no |
55+
| <a name="input_custom_iam_instance_profile"></a> [custom\_iam\_instance\_profile](#input\_custom\_iam\_instance\_profile) | RDS custom iam instance profile | `string` | `null` | no |
5556
| <a name="input_db_name"></a> [db\_name](#input\_db\_name) | The DB name to create. If omitted, no database is created initially | `string` | `null` | no |
5657
| <a name="input_db_subnet_group_name"></a> [db\_subnet\_group\_name](#input\_db\_subnet\_group\_name) | Name of DB subnet group. DB instance will be created in the VPC associated with the DB subnet group. If unspecified, will be created in the default VPC | `string` | `null` | no |
5758
| <a name="input_delete_automated_backups"></a> [delete\_automated\_backups](#input\_delete\_automated\_backups) | Specifies whether to remove automated backups immediately after the DB instance is deleted | `bool` | `true` | no |

modules/db_instance/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ resource "aws_db_instance" "this" {
5151
domain = var.domain
5252
domain_iam_role_name = var.domain_iam_role_name
5353
iam_database_authentication_enabled = var.iam_database_authentication_enabled
54+
custom_iam_instance_profile = var.custom_iam_instance_profile
5455

5556
vpc_security_group_ids = var.vpc_security_group_ids
5657
db_subnet_group_name = var.db_subnet_group_name

modules/db_instance/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ variable "identifier" {
88
description = "The name of the RDS instance"
99
type = string
1010
}
11+
variable "custom_iam_instance_profile" {
12+
description = "RDS custom iam instance profile"
13+
type = string
14+
default = null
15+
}
1116

1217
variable "use_identifier_prefix" {
1318
description = "Determines whether to use `identifier` as is or create a unique identifier beginning with `identifier` as the specified prefix"

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ variable "instance_use_identifier_prefix" {
99
default = false
1010
}
1111

12+
variable "custom_iam_instance_profile" {
13+
description = "RDS custom iam instance profile"
14+
type = string
15+
default = null
16+
}
17+
1218
variable "allocated_storage" {
1319
description = "The allocated storage in gigabytes"
1420
type = string

0 commit comments

Comments
 (0)