Skip to content
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

Conditional creation of cluster and related resources #7

Closed
wants to merge 6 commits into from
Closed

Conditional creation of cluster and related resources #7

wants to merge 6 commits into from

Conversation

max-rocket-internet
Copy link
Contributor

Adding create_resources to allow declaring the module without creating any resources. This is mentioned in #2

@max-rocket-internet
Copy link
Contributor Author

@antonbabenko can you please review?

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments (mostly newlines after count)

main.tf Outdated
@@ -83,15 +84,13 @@ data "aws_iam_policy_document" "monitoring_rds_assume_role" {
}

resource "aws_iam_role" "rds_enhanced_monitoring" {
count = "${var.monitoring_interval > 0 ? 1 : 0}"

count = "${var.create_resources ? var.monitoring_interval > 0 ? 1 : 0 : 0}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less comparisons is nicer, I believe:

Suggested change
count = "${var.create_resources ? var.monitoring_interval > 0 ? 1 : 0 : 0}"
count = "${var.create_resources && var.monitoring_interval > 0 ? 1 : 0}"

main.tf Outdated
@@ -129,6 +128,7 @@ resource "aws_appautoscaling_policy" "autoscaling_read_replica_count" {
}

resource "aws_security_group" "this" {
count = "${var.create_resources}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets keep empty lines after count and always have it as the first one because this is meta-argument.

main.tf Outdated
@@ -137,8 +137,7 @@ resource "aws_security_group" "this" {
}

resource "aws_security_group_rule" "default_ingress" {
count = "${length(var.allowed_security_groups)}"

count = "${var.create_resources ? length(var.allowed_security_groups) : 0}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. New line is missing.

@max-rocket-internet max-rocket-internet deleted the conditional_creation branch November 22, 2018 08:53
@igat64
Copy link

igat64 commented Sep 7, 2020

Hi there!

@max-rocket-internet, I'm wondering why this feature wasn't delivered?

@max-rocket-internet
Copy link
Contributor Author

Hi @igat64, sorry I can't remember exactly. Perhaps because the review process was going too slowly. Here's our copy of the module, the original version of the module here: https://github.com/deliveryhero/tf-aws-rds-aurora

@igat64
Copy link

igat64 commented Sep 7, 2020

Ok, thank you @max-rocket-internet !

bryantbiggs pushed a commit to bryantbiggs/terraform-aws-rds-aurora that referenced this pull request Aug 16, 2022
…eam-master

[HARRI-136652]: Sync the upstream plus the custom changes
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants