-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
add(outputs): paramter_group_name and option_group_name #181
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,76 @@ | ||
extends: .github | ||
# https://docs.mergify.io/conditions.html | ||
# https://docs.mergify.io/actions.html | ||
pull_request_rules: | ||
- name: "approve automated PRs that have passed checks" | ||
conditions: | ||
- "author~=^(cloudpossebot|renovate\\[bot\\])$" | ||
- "-closed" | ||
- "head~=^(auto-update|renovate)/.*" | ||
- "check-success=test/bats" | ||
- "check-success=test/readme" | ||
- "check-success=test/terratest" | ||
- "check-success=validate-codeowners" | ||
- or: | ||
- "base=master" | ||
- "base=main" | ||
- "base~=^release/v\\d{1,2}$" | ||
|
||
actions: | ||
review: | ||
type: "APPROVE" | ||
bot_account: "cloudposse-mergebot" | ||
message: "We've automatically approved this PR because the checks from the automated Pull Request have passed." | ||
|
||
- name: "merge automated PRs when approved and tests pass" | ||
conditions: | ||
- "author~=^(cloudpossebot|renovate\\[bot\\])$" | ||
- "-closed" | ||
- "head~=^(auto-update|renovate)/.*" | ||
- "check-success=test/bats" | ||
- "check-success=test/readme" | ||
- "check-success=test/terratest" | ||
- "check-success=validate-codeowners" | ||
- "#approved-reviews-by>=1" | ||
- "#changes-requested-reviews-by=0" | ||
- "#commented-reviews-by=0" | ||
- or: | ||
- "base=master" | ||
- "base=main" | ||
- "base~=^release/v\\d{1,2}$" | ||
|
||
actions: | ||
merge: | ||
method: "squash" | ||
|
||
- name: "delete the head branch after merge" | ||
conditions: | ||
- "merged" | ||
actions: | ||
delete_head_branch: {} | ||
|
||
- name: "ask to resolve conflict" | ||
conditions: | ||
- "conflict" | ||
- "-closed" | ||
actions: | ||
comment: | ||
message: "This pull request is now in conflict. Could you fix it @{{author}}? 🙏" | ||
|
||
- name: "remove outdated reviews" | ||
conditions: | ||
- or: | ||
- "base=master" | ||
- "base=main" | ||
- "base~=^release/v\\d{1,2}$" | ||
actions: | ||
dismiss_reviews: | ||
changes_requested: true | ||
approved: true | ||
message: "This Pull Request has been updated, so we're dismissing all reviews." | ||
|
||
- name: "close Pull Requests without files changed" | ||
conditions: | ||
- "#files=0" | ||
actions: | ||
close: | ||
message: "This pull request has been automatically closed by Mergify because there are no longer any changes." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,21 +142,22 @@ resource "aws_db_parameter_group" "default" { | |
} | ||
|
||
resource "aws_db_option_group" "default" { | ||
count = length(var.option_group_name) == 0 && module.this.enabled ? 1 : 0 | ||
|
||
name_prefix = "${module.this.id}${module.this.delimiter}" | ||
name = var.option_group_name | ||
count = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if |
||
engine_name = var.engine | ||
major_engine_version = local.major_engine_version | ||
tags = module.this.tags | ||
major_engine_version = var.major_engine_version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why changing these two lines
|
||
tags = var.tags | ||
|
||
dynamic "option" { | ||
for_each = var.db_options | ||
content { | ||
db_security_group_memberships = lookup(option.value, "db_security_group_memberships", null) | ||
option_name = option.value.option_name | ||
port = lookup(option.value, "port", null) | ||
version = lookup(option.value, "version", null) | ||
vpc_security_group_memberships = lookup(option.value, "vpc_security_group_memberships", null) | ||
option_name = option.value.option_name | ||
version = lookup(option.value, "version", null) | ||
|
||
# Include port and security groups only if they are defined and not for SQLSERVER_BACKUP_RESTORE | ||
db_security_group_memberships = option.value.option_name != "SQLSERVER_BACKUP_RESTORE" ? lookup(option.value, "db_security_group_memberships", []) : null | ||
vpc_security_group_memberships = option.value.option_name != "SQLSERVER_BACKUP_RESTORE" ? lookup(option.value, "vpc_security_group_memberships", []) : null | ||
port = option.value.option_name != "SQLSERVER_BACKUP_RESTORE" ? lookup(option.value, "port", null) : null | ||
|
||
dynamic "option_settings" { | ||
for_each = lookup(option.value, "option_settings", []) | ||
|
@@ -167,12 +168,7 @@ resource "aws_db_option_group" "default" { | |
} | ||
} | ||
} | ||
|
||
lifecycle { | ||
create_before_destroy = true | ||
} | ||
} | ||
|
||
resource "aws_db_subnet_group" "default" { | ||
count = module.this.enabled && local.subnet_ids_provided && !local.db_subnet_group_name_provided ? 1 : 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
hmm, this completely changes the behavior of the module.
Before, if
var.option_group_name
was provided, it was used as an existing option grouo and no new option grouo was created.After this change,
var.option_group_name
is the name of the new option group to create.Also,
name_prefix
was useful to create many option groups for the same cluster.@flightlesstux can you maybe update it to maintain backwards compatibility? (otherwise, it will break many existing deployments)