This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 191
Adding authentication plugin support, mainly for AWSAuthenticationPlu… #26
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ad5fd28
Adding authentication plugin support, mainly for AWSAuthenticationPlu…
ed549cc
Fixes @vancluever requested at https://github.com/terraform-providers…
30996cd
Fixed update user to use 'auth' as a string, also updated unit tests …
5b3ee76
Changed 'auth' to 'auth_plugin' as per @vancluever's input and update…
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
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 |
---|---|---|
|
@@ -26,6 +26,16 @@ resource "mysql_user" "jdoe" { | |
} | ||
``` | ||
|
||
```hcl | ||
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. Could a heading be added here denoting that this example is a an example using an authentication plugin? |
||
resource "mysql_user" "nologin" { | ||
user = "nologin" | ||
host = "example.com" | ||
auth { | ||
plugin = "mysql_no_login" | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
@@ -36,11 +46,24 @@ The following arguments are supported: | |
|
||
* `plaintext_password` - (Optional) The password for the user. This must be | ||
provided in plain text, so the data source for it must be secured. | ||
An _unsalted_ hash of the provided password is stored in state. | ||
An _unsalted_ hash of the provided password is stored in state. Conflicts | ||
with `auth`. | ||
|
||
* `password` - (Optional) Deprecated alias of `plaintext_password`, whose | ||
value is *stored as plaintext in state*. Prefer to use `plaintext_password` | ||
instead, which stores the password as an unsalted hash. | ||
instead, which stores the password as an unsalted hash. Conflicts with | ||
`auth`. | ||
|
||
* `auth` - (Optional) Block which supports the use of authentication plugins. | ||
Description of the fields allowed in the block below. Conflicts with `password` | ||
and `plaintext_password`. | ||
|
||
The auth block supports: | ||
|
||
* `plugin` - (Required) The plugin to use with the user. Currently only uses | ||
"AWSAuthenticationPlugin" and "mysql_no_login". For more information about | ||
"AWSAuthenticationPlugin" and using it with Aurora: | ||
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html#UsingWithRDS.IAMDBAuth.Creating | ||
|
||
## Attributes Reference | ||
|
||
|
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.
Can this be modified to
auth_plugin
, and make to be a flatTypeString
value? I'm not too sure if we will ever be putting anything else in here - grants are already handled bymysql_grant
, and we already have separate fields for plaintext passwords. So having the extra layer here is not entirely useful as it stands right now.The field should also be made to conflict with all other authentication fields (including
password
as well, even though it's deprecated, it can still be used).