-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better use of tags as map #18
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the ability to use mapped tags, but suggest we don't force the use of the identifier prefix in the same commit.
envname = "${var.envname}" | ||
envtype = "${var.envtype}" | ||
} | ||
tags = "${merge(var.tags, map("Name", format("%s", var.identifier_prefix)))}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are forcing the use of a Name tag assigned to the identifier_prefix, as well as any tags in the map. Can we not have this?
variable "identifier_prefix" { | ||
type = "string" | ||
default = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave the default for the identifier_prefix?
} | ||
|
||
// Create single DB instance | ||
resource "aws_rds_cluster_instance" "cluster_instance_0" { | ||
identifier = "${var.identifier_prefix != "" ? format("%s-node-0", var.identifier_prefix) : format("%s-aurora-node-0", var.envname)}" | ||
identifier = "${format("%s-node-0", var.identifier_prefix)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow the identifier_prefix to be empty
envname = "${var.envname}" | ||
envtype = "${var.envtype}" | ||
} | ||
tags = "${merge(var.tags, map("Name", format("%s", var.identifier_prefix)))}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@@ -201,7 +201,7 @@ resource "aws_rds_cluster_instance" "cluster_instance_n" { | |||
count = "${var.replica_scale_enabled ? var.replica_scale_min : var.replica_count}" | |||
engine = "${var.engine}" | |||
engine_version = "${var.engine-version}" | |||
identifier = "${var.identifier_prefix != "" ? format("%s-node-%d", var.identifier_prefix, count.index + 1) : format("%s-aurora-node-%d", var.envname, count.index + 1)}" | |||
identifier = "${format("%s-node-%d", var.identifier_prefix, count.index + 1)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
envname = "${var.envname}" | ||
envtype = "${var.envtype}" | ||
} | ||
tags = "${merge(var.tags, map("Name", format("%s", var.identifier_prefix)))}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
} | ||
|
||
// Create DB Cluster | ||
resource "aws_rds_cluster" "default" { | ||
cluster_identifier = "${var.identifier_prefix != "" ? format("%s-cluster", var.identifier_prefix) : format("%s-aurora-cluster", var.envname)}" | ||
cluster_identifier = "${format("%s-cluster", var.identifier_prefix)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@@ -266,7 +263,7 @@ data "aws_iam_policy_document" "monitoring-rds-assume-role-policy" { | |||
|
|||
resource "aws_iam_role" "rds-enhanced-monitoring" { | |||
count = "${var.monitoring_interval > 0 ? 1 : 0}" | |||
name = "rds-enhanced-monitoring-${var.envname}" | |||
name = "rds-enhanced-monitoring-${var.identifier_prefix}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest the iam_role name is parameterised
My thoughts on this:
|
Any movement on this? Seems like a pretty big gap and is putting us in the position of having to maintain our own fork just for this feature. |
I think we should go with #32 because it's backwards compatible and only deals with tags, not names. @zacharyabresch would #32 work for you? |
Definitely. I'm also looking for just tags to be functional. In the meantime, we're maintaining a private fork but we'd rather not. |
No description provided.