Skip to content

Commit

Permalink
Fixed warning in output (fixes #32 and #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Dec 8, 2017
1 parent 7d1ad36 commit 9bd4d7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "db" {
identifier = "demodb"
engine = "mysql"
engine_version = "5.7.11"
engine_version = "5.7.19"
instance_class = "db.t2.large"
allocated_storage = 5
Expand Down
3 changes: 2 additions & 1 deletion examples/complete/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ module "db" {

identifier = "demodb"

# All available versions: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt
engine = "mysql"
engine_version = "5.7.11"
engine_version = "5.7.19"
instance_class = "db.t2.large"
allocated_storage = 5
storage_encrypted = false
Expand Down
4 changes: 2 additions & 2 deletions modules/db_parameter_group/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# DB parameter group
output "this_db_parameter_group_id" {
description = "The db parameter group id"
value = "${aws_db_parameter_group.this.id}"
value = "${element(split(",", join(",", aws_db_parameter_group.this.*.id)), 0)}"
}

output "this_db_parameter_group_arn" {
description = "The ARN of the db parameter group"
value = "${aws_db_parameter_group.this.arn}"
value = "${element(split(",", join(",", aws_db_parameter_group.this.*.arn)), 0)}"

This comment has been minimized.

Copy link
@omeid

omeid Mar 18, 2018

is the join and split necessary?

This comment has been minimized.

Copy link
@antonbabenko

antonbabenko Mar 19, 2018

Author Member

Good catch, this can be like -${element(concat(aws_db_parameter_group.this.*.arn, list("")), 0)}.

This comment has been minimized.

Copy link
@omeid

omeid Mar 19, 2018

Could also use coalescelist instead of concat. :)

This comment has been minimized.

Copy link
@antonbabenko

antonbabenko Mar 19, 2018

Author Member

Not sure, coalescelist expects that "at least two arguments must be provided". https://www.terraform.io/docs/configuration/interpolation.html#coalescelist-list1-list2-

This comment has been minimized.

Copy link
@omeid

omeid Mar 19, 2018

${element(coalescelist(aws_db_parameter_group.this.*.arn, list("")), 0)} works.

}

0 comments on commit 9bd4d7e

Please sign in to comment.