-
-
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
Optional user and password #119
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
1ce66d2
to
76b906c
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
76b906c
to
55c544f
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
a856295
to
1ea1d29
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
bd54666
to
3e4c2b1
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
1fefa0b
to
15c41e7
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
d5b3c25
to
d007100
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
ff54317
to
f5b85a4
Compare
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
/test terratest |
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
See comment above regarding database_name = null
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.
Bridgecrew has found 2 infrastructure configuration errors in this PR ⬇️
/test all |
# Leave special characters out to avoid quoting and other issues. | ||
# Special characters have no additional security compared to increasing length. | ||
special = false | ||
override_special = "!#$%^&*()<>-_" |
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.
AFAIU, you don't need
override_specialif you include
special = false`. No harm no foul, but just mentioning.
@@ -0,0 +1,96 @@ | |||
# AWS KMS alias used for encryption/decryption of SSM secure strings | |||
variable "kms_alias_name_ssm" { |
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.
Why put the variable
and output
block into this file? I get that they're isolated to systems manager related functionality, but I'd still prefer to see them all live in their typical places (i.e. variables.tf
and outputs.tf
).
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.
I think because this was a precursor to putting it in its own module eventually. That way it would be easier to migrate. We can put it into variables.tf
, it would just make migration slightly more difficult.
We frequently do this in our components. Have a specific <service>-variables.tf
or variables-<service>.tf
file so it's easier for copy pasta. I figured the same methodology could be applied in the modules too.
systems-manager.tf
Outdated
variable "ssm_parameters_enabled" { | ||
type = bool | ||
default = false | ||
description = "If `true` create SSM keys for the database user and password." |
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.
This is controlling more than just the PStore params for user + pass since you're also including hostname + port. I'd update or better yet make this a more generic "for the database info".
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.
@nitrocode looks good overall. One thing that bugs me is co-locating vars + outputs in the systems-manager.tf file. I don't like that because even with autogenerated READMEs, in small child modules like this it means I need to dig around when I can't find a variable block.
Also, I wonder if outputting important values like you're doing here to SSM PStore is something only components should do and the child modules should be simpler? Thoughts?
I think we need a separated module for SSM / Secrets Manager like @jamengual mentioned. Then we can easily turn it on and off and have the variables located in the upstream module instead of here. We can do some of it by using https://github.com/cloudposse/terraform-aws-ssm-parameter-store but not the password creation. I was thinking about doing that later but maybe it should be a prerequisite for this PR. |
This pull request is now in conflict. Could you fix it @nitrocode? 🙏 |
@nitrocode It would be great if you could make Possible scenario would be I would like to do some modifications after I created the db instance from a snapshot and if Thanks! |
@arischow thanks for the suggestion. This PR is only for generating password credentials. Could you write that into a separate issue so we can track it? |
This pull request is now in conflict. Could you fix it @nitrocode? 🙏 |
what
why
references
notes
ssm_enabled
be renamed tossm_parameters_enabled
to be more explicit ?ssm_key_prefix
instead of having to modify thessm_key_format
?module.rds_instance.hostname
andvar.database_port
to ssm ?systems-manager.tf
file ?var.ssm_region
and if one isn't passed in, it could use the current region ?database_name = ""
ornull
, should the name of the database be themodule.this.id
?database_name = null
so that means the ssm key itself would have the termnull
in there. Perhaps for ssm, if thedatabase_name == null
then we can use the uniquemodule.this.id
ormodule.this.name
?module.this.name
output
enable ssm with defaults
With
ssm_parameters_enabled = true
enable ssm with merge defaults
With
ssm_parameters_enabled = true
and