Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-rds
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-rds
Commits
dc96ef02
Unverified
Commit
dc96ef02
authored
Mar 18, 2021
by
Bryant Biggs
Committed by
GitHub
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: correct monitoring role ARN lookup (#318)
parent
66cfff15
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
25 additions
and
2 deletions
+25
-2
README.md
examples/complete-mssql/README.md
+1
-0
main.tf
examples/complete-mssql/main.tf
+1
-0
outputs.tf
examples/complete-mssql/outputs.tf
+5
-0
README.md
examples/complete-mysql/README.md
+1
-0
main.tf
examples/complete-mysql/main.tf
+1
-0
outputs.tf
examples/complete-mysql/outputs.tf
+5
-0
README.md
examples/complete-postgres/README.md
+1
-0
main.tf
examples/complete-postgres/main.tf
+1
-0
outputs.tf
examples/complete-postgres/outputs.tf
+5
-0
main.tf
modules/db_instance/main.tf
+4
-2
No files found.
examples/complete-mssql/README.md
View file @
dc96ef02
...
...
@@ -53,6 +53,7 @@ No input.
| Name | Description |
|------|-------------|
| this
\_
db
\_
enhanced
\_
monitoring
\_
iam
\_
role
\_
arn | The Amazon Resource Name (ARN) specifying the monitoring role |
| this
\_
db
\_
instance
\_
address | The address of the RDS instance |
| this
\_
db
\_
instance
\_
arn | The ARN of the RDS instance |
| this
\_
db
\_
instance
\_
availability
\_
zone | The availability zone of the RDS instance |
...
...
examples/complete-mssql/main.tf
View file @
dc96ef02
...
...
@@ -149,6 +149,7 @@ module "db" {
performance_insights_enabled
=
true
performance_insights_retention_period
=
7
create_monitoring_role
=
true
monitoring_interval
=
60
options
=
[]
create_db_parameter_group
=
false
...
...
examples/complete-mssql/outputs.tf
View file @
dc96ef02
...
...
@@ -88,3 +88,8 @@ output "this_db_instance_domain_iam_role_name" {
description
=
"The name of the IAM role to be used when making API calls to the Directory Service. "
value
=
module
.
db
.
this_db_instance_domain_iam_role_name
}
output
"this_db_enhanced_monitoring_iam_role_arn"
{
description
=
"The Amazon Resource Name (ARN) specifying the monitoring role"
value
=
module
.
db
.
enhanced_monitoring_iam_role_arn
}
examples/complete-mysql/README.md
View file @
dc96ef02
...
...
@@ -63,6 +63,7 @@ No input.
| db
\_
default
\_
parameter
\_
group
\_
id | The db parameter group id |
| db
\_
default
\_
subnet
\_
group
\_
arn | The ARN of the db subnet group |
| db
\_
default
\_
subnet
\_
group
\_
id | The db subnet group name |
| this
\_
db
\_
enhanced
\_
monitoring
\_
iam
\_
role
\_
arn | The Amazon Resource Name (ARN) specifying the monitoring role |
| this
\_
db
\_
instance
\_
address | The address of the RDS instance |
| this
\_
db
\_
instance
\_
arn | The ARN of the RDS instance |
| this
\_
db
\_
instance
\_
availability
\_
zone | The availability zone of the RDS instance |
...
...
examples/complete-mysql/main.tf
View file @
dc96ef02
...
...
@@ -94,6 +94,7 @@ module "db" {
performance_insights_enabled
=
true
performance_insights_retention_period
=
7
create_monitoring_role
=
true
monitoring_interval
=
60
parameters
=
[
{
...
...
examples/complete-mysql/outputs.tf
View file @
dc96ef02
...
...
@@ -79,6 +79,11 @@ output "this_db_parameter_group_arn" {
value
=
module
.
db
.
this_db_parameter_group_arn
}
output
"this_db_enhanced_monitoring_iam_role_arn"
{
description
=
"The Amazon Resource Name (ARN) specifying the monitoring role"
value
=
module
.
db
.
enhanced_monitoring_iam_role_arn
}
# Default
output
"db_default_instance_address"
{
description
=
"The address of the RDS instance"
...
...
examples/complete-postgres/README.md
View file @
dc96ef02
...
...
@@ -63,6 +63,7 @@ No input.
| db
\_
default
\_
parameter
\_
group
\_
id | The db parameter group id |
| db
\_
default
\_
subnet
\_
group
\_
arn | The ARN of the db subnet group |
| db
\_
default
\_
subnet
\_
group
\_
id | The db subnet group name |
| this
\_
db
\_
enhanced
\_
monitoring
\_
iam
\_
role
\_
arn | The Amazon Resource Name (ARN) specifying the monitoring role |
| this
\_
db
\_
instance
\_
address | The address of the RDS instance |
| this
\_
db
\_
instance
\_
arn | The ARN of the RDS instance |
| this
\_
db
\_
instance
\_
availability
\_
zone | The availability zone of the RDS instance |
...
...
examples/complete-postgres/main.tf
View file @
dc96ef02
...
...
@@ -97,6 +97,7 @@ module "db" {
performance_insights_enabled
=
true
performance_insights_retention_period
=
7
create_monitoring_role
=
true
monitoring_interval
=
60
parameters
=
[
{
...
...
examples/complete-postgres/outputs.tf
View file @
dc96ef02
...
...
@@ -79,6 +79,11 @@ output "this_db_parameter_group_arn" {
value
=
module
.
db
.
this_db_parameter_group_arn
}
output
"this_db_enhanced_monitoring_iam_role_arn"
{
description
=
"The Amazon Resource Name (ARN) specifying the monitoring role"
value
=
module
.
db
.
enhanced_monitoring_iam_role_arn
}
# Default
output
"db_default_instance_address"
{
description
=
"The address of the RDS instance"
...
...
modules/db_instance/main.tf
View file @
dc96ef02
locals
{
is_mssql
=
element
(
split
(
"-"
,
var
.
engine
),
0
)
==
"sqlserver"
monitoring_role_arn
=
var
.
create_monitoring_role
?
aws_iam_role
.
enhanced_monitoring
[
0
]
.
arn
:
var
.
monitoring_role_arn
}
# Ref. https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
...
...
@@ -68,7 +70,7 @@ resource "aws_db_instance" "this" {
backup_window
=
var
.
backup_window
max_allocated_storage
=
var
.
max_allocated_storage
monitoring_interval
=
var
.
monitoring_interval
monitoring_role_arn
=
var
.
monitoring_interval
>
0
?
coalesce
(
var
.
monitoring_role_arn
,
join
(
", "
,
aws_iam_role
.
enhanced_monitoring
.*.
arn
),
null
)
:
null
monitoring_role_arn
=
var
.
monitoring_interval
>
0
?
local
.
monitoring_role_arn
:
null
character_set_name
=
var
.
character_set_name
enabled_cloudwatch_logs_exports
=
var
.
enabled_cloudwatch_logs_exports
...
...
@@ -154,7 +156,7 @@ resource "aws_db_instance" "this_mssql" {
backup_window
=
var
.
backup_window
max_allocated_storage
=
var
.
max_allocated_storage
monitoring_interval
=
var
.
monitoring_interval
monitoring_role_arn
=
var
.
monitoring_interval
>
0
?
coalesce
(
var
.
monitoring_role_arn
,
aws_iam_role
.
enhanced_monitoring
.*.
arn
,
null
)
:
null
monitoring_role_arn
=
var
.
monitoring_interval
>
0
?
local
.
monitoring_role_arn
:
null
character_set_name
=
var
.
character_set_name
timezone
=
var
.
timezone
# MSSQL only
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment