-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat!: Update default values for security posture improvement #369
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
Merged
antonbabenko
merged 17 commits into
terraform-aws-modules:master
from
bryantbiggs:feat/updates
Feb 16, 2022
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9ed54b4
chore: fix outputs to use current standards
bryantbiggs 97c24ae
chore: update default settings for security improvements
bryantbiggs 42bb71f
feat: set null for username, password, engine when using existing sou…
bryantbiggs 9930aaf
feat: bump provider version to support latest attribute update, bump …
bryantbiggs 2bbb20c
feat!: change default to use random password of length 16 and remove …
bryantbiggs 93760a4
chore: add PR title check workflow
bryantbiggs 5450053
chore: add upgrade guide
bryantbiggs c3de340
chore: updates from testing
bryantbiggs 999cacd
chore: update release configs based on EKS findings
bryantbiggs ebd1603
Merge branch 'master' of github.com:terraform-aws-modules/terraform-a…
bryantbiggs d368766
Merge branch 'master' into feat/updates
bryantbiggs 029b06b
feat: replace `var.name` with `var.db_name` due to deprecation, bump …
bryantbiggs 2418f85
fix: update default values to be `null` where possible
bryantbiggs bb05127
chore: upgrade engines to latest version
bryantbiggs 2b7f945
fix: remove duplicated instance just for sqlserver, we can handle as …
bryantbiggs 52281a7
chore: update upgrade document
bryantbiggs b311f3e
chore: update main README
bryantbiggs 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 hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Upgrade from v3.x to v4.x | ||
|
||
If you have any questions regarding this upgrade process, please consult the [`examples/`](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples) projects: | ||
|
||
If you find a bug, please open an issue with supporting configuration to reproduce. | ||
|
||
## List of backwards incompatible changes | ||
|
||
- Support for Terraform `<=v0.12.x` has been dropped; `v0.13.1` is now the minimum supported version | ||
- Terraform AWS provider minimum version is now `v4.0.0` in order to support the replacement of `var.name`(deprecated) for `var.db_name` | ||
- Separate RDS instance resource for MSSQL/SQLServer has been removed - all engines are supported under one resource | ||
- `storage_encrypted` is now set to `true` by default; was previously `false` | ||
- `create_random_password` is now set to `true` by default; was previously `false` | ||
- `create_db_subnet_group` is now set to `false` by default; was previously `true`; typically a shared DB subnet group will be used, most likely from the VPC module | ||
- `random_password_length` is now set to `16` by default, was previously `10` | ||
- Random provider minimum version supported is now `v3.1.0` | ||
- `final_snapshot_identifier` no longer coalesces `var.final_snapshot_identifier` and instead relies on `var.final_snapshot_identifier_prefix` with a random suffix to avoid name collisions | ||
|
||
## Additional changes | ||
|
||
### Added | ||
|
||
- `latest_restorable_time` added to ignored changes | ||
- `replica_mode` support added to DB instance | ||
|
||
### Modified | ||
|
||
- `username`, `password`, and `engine` are set to `null` when a `replicate_source_db` or `snapshot_identifier` is provided; these values are already provided in the respective source | ||
- `engine_version` is set to `null` when a value is provided for `replicate_source_db` | ||
- `db_subnet_group_name` has been updated to use full name when prefix is enabled | ||
- `Name` tag removed from instance resource; name is set via `identifier` and not through tags; users can add back into the tags they provide if desired | ||
- Outputs have been updated to use `try()` syntax; local variable usage has been removed within outputs | ||
- `engine`, `major_engine_version`, `family`, `password`, `db_subnet_group_name`,`db_subnet_group_description`,`parameter_group_name`, | ||
`parameter_group_description`, `option_group_name`, `option_group_description` is now set to `null` by default; was previously `""` | ||
- `timeouts` is now set to `{}` by default; was previously a copy+paste of default value used by provider. This is a no-op but will show up in plans as a diff | ||
|
||
### Variable and output changes | ||
|
||
1. Removed variables: | ||
|
||
- `final_snapshot_identifier` | ||
|
||
2. Renamed variables: | ||
|
||
- `name` (deprecated) -> `db_name` | ||
|
||
3. Added variables: | ||
|
||
- `replica_mode` | ||
|
||
4. Removed outputs: | ||
|
||
- None | ||
|
||
5. Renamed outputs: | ||
|
||
- None | ||
|
||
6. Added outputs: | ||
|
||
- None | ||
|
||
## Upgrade Migrations | ||
|
||
The following examples demonstrate some of the changes that users can elect to make to avoid any potential disruptions when upgrading. | ||
|
||
### Before 3.x Example | ||
|
||
```hcl | ||
module "rds" { | ||
source = "terraform-aws-modules/rds/aws" | ||
version = "~> 3.0" | ||
|
||
master_password = "MySuperStrongPassword!" | ||
|
||
# Previously on read-replicas or restored from snapshot instances you needed to explicitly set these to null | ||
# These can now be safely removed and instead on the module to resolve these appropriately | ||
username = null | ||
password = null | ||
engine = null | ||
} | ||
``` | ||
|
||
### After 4.x Example | ||
|
||
```hcl | ||
module "asg" { | ||
source = "terraform-aws-modules/rds/aws" | ||
version = "~> 4.0" | ||
|
||
master_password = "MySuperStrongPassword!" | ||
# Set random password creation to false if providing your own password as input | ||
create_random_password = false | ||
|
||
# If you did not have storage encrypted in `v3.x`, you can explicitly disable in `v4.x` to avoid disruption | ||
storage_encrypted = false | ||
} | ||
``` | ||
|
||
#### MSSQL/SQLServer | ||
|
||
For MSSSQL/SQLServer, users will want to rename the resource in their Terraform state to align with the flattened DB instance resource module in v4.x: | ||
|
||
```bash | ||
terraform state mv 'module.<module-name>.module.db_instance.aws_db_instance.this_mssql[0]' 'module.<module-name>.module.db_instance.aws_db_instance.this[0]' | ||
``` | ||
|
||
Where `<module-name>` is the name of your module definition. |
This file contains hidden or 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 hidden or 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 hidden or 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,10 +1,10 @@ | ||
terraform { | ||
required_version = ">= 0.12.26" | ||
required_version = ">= 0.13.1" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 2.49" | ||
version = ">= 4.0" | ||
} | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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,10 +1,10 @@ | ||
terraform { | ||
required_version = ">= 0.12.26" | ||
required_version = ">= 0.13.1" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 2.49" | ||
version = ">= 4.0" | ||
} | ||
} | ||
} |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.