-
Notifications
You must be signed in to change notification settings - Fork 555
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 vault_config_ui_custom_message resource #2154
Merged
marcboudreau
merged 11 commits into
main
from
marcboudreau/VAULT-22504/custom-message-resource
Mar 19, 2024
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
038f19b
add custom message resource
ee56e5f
fix filename
b1de368
corrected field type for link
c5fe3d7
adjusted link field value based on ssh_backend_role example
670b52e
fixed error with reading link value from API response
c9be60e
add CHANGELOG entry
0972440
fix failing unit test
24fae95
rename files to non-plural form
6eb6bfe
improve change description and moved it to existing FEATURES section
0129c2d
add documentation for new resource
759323a
remove custom-message resource from state if it doesn't exist in Vault
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
layout: "vault" | ||
page_title: "Vault: vault_config_ui_custom_message resource" | ||
sidebar_current: "docs-vault-resource-config-ui-custom-message" | ||
description: |- | ||
Manages a UI custom message in Vault. | ||
--- | ||
|
||
# vault\_config\_ui\_custom\_message | ||
|
||
Manages a UI custom message in Vault. Custom messages are displayed in the Vault UI either on the login page or immediately after succesfully logging in. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "vault_config_ui_custom_message" "maintenance" { | ||
title = "Upcoming maintenance" | ||
message = base64encode("Vault will be offline for planned maintenance on February 1st, 2024 from 05:00Z to 08:00Z") | ||
type = "banner" | ||
authenticated = true | ||
start_time = "2024-01-01T00:00:00.000Z" | ||
end_time = "2024-02-01T05:00:00.000Z" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `namespace` - (Optional) The namespace to provision the resource in. | ||
The value should not contain leading or trailing forward slashes. | ||
The `namespace` is always relative to the provider's configured [namespace](/docs/providers/vault#namespace). | ||
*Available only for Vault Enterprise*. | ||
|
||
* `title` - (Required) The title of the custom message to create. | ||
|
||
* `message` - (Required) The base64-encoded content of the custom message. | ||
|
||
* `start_time` - (Required) The time when the custom message begins to be active. This value can be set to a future time, but cannot | ||
occur on or after the `end_time` value. | ||
|
||
* `authenticated` - (Optional) The value `true` if the custom message is displayed after logins are completed or `false` if they are | ||
displayed during the login in the Vault UI. The default value is `true`. | ||
|
||
* `type` - (Optional) The presentation type of the custom message. Must be one of the following values: `banner` or `modal`. | ||
|
||
* `end_time` - (Optional) The time when the custom message expires. If this value is not specified, the custom message never expires. | ||
|
||
* `link` - (Optional) A hyperlink to be included with the message. [See below for more details](#link). | ||
|
||
* `options` - (Optional) A map of additional options that can be set on the custom message. | ||
|
||
### Link | ||
|
||
* `title` - (Required) The hyperlink title that is displayed in the custom message. | ||
|
||
* `href` - (Required) The URL set in the hyperlink's href attribute. | ||
|
||
## Attributes Reference | ||
|
||
No additional attributes are exported by this resource. | ||
|
||
## Import | ||
|
||
Custom messages can be imported using their `id` e.g. | ||
|
||
``` | ||
$ terraform import vault_config_ui_custom_message.maintenance df773ef1-2794-45d3-9e25-bcccffe4dbde | ||
``` |
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
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.
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.
We need to prepend the log with a level. I would recommend either DEBUG or WARN: