Skip to content

Commit

Permalink
Use realistic examples and tests for config_store resource (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryrecker-pingidentity authored Nov 13, 2024
1 parent 632339c commit ec14b04
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 30 deletions.
39 changes: 34 additions & 5 deletions docs/resources/config_store.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,42 @@ description: |-

Resource to create and manage bundle settings.

## Example Usage
## Example Usage - String

```terraform
resource "pingfederate_config_store" "example" {
bundle = "MyBundle"
setting_id = "MySetting"
string_value = "stringval"
resource "pingfederate_config_store" "enable_expressions" {
bundle = "org.sourceid.common.ExpressionManager"
setting_id = "evaluateExpressions"
string_value = "true"
}
```

## Example Usage - List

```terraform
resource "pingfederate_config_store" "base64_required_plugins" {
bundle = "org.sourceid.oauth20.handlers.process.exchange.execution.SecurityTokenCreator"
setting_id = "base64-required-plugins"
list_value = ["org.sourceid.wstrust.processor.oauth.BearerAccessTokenTokenProcessor"]
}
```

## Example Usage - Map

```terraform
resource "pingfederate_config_store" "signature_algorithms" {
bundle = "com.pingidentity.crypto.SignatureAlgorithms"
setting_id = "signature-algorithms"
map_value = {
"DSA_SHA1" : "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
"RSA_SHA1" : "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
"RSA_SHA256" : "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
"RSA_SHA384" : "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
"RSA_SHA512" : "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
"ECDSA_SHA256" : "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"
"ECDSA_SHA384" : "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"
"ECDSA_SHA512" : "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"
}
}
```

Expand Down
5 changes: 5 additions & 0 deletions examples/resources/pingfederate_config_store/resource-list.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "pingfederate_config_store" "base64_required_plugins" {
bundle = "org.sourceid.oauth20.handlers.process.exchange.execution.SecurityTokenCreator"
setting_id = "base64-required-plugins"
list_value = ["org.sourceid.wstrust.processor.oauth.BearerAccessTokenTokenProcessor"]
}
14 changes: 14 additions & 0 deletions examples/resources/pingfederate_config_store/resource-map.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "pingfederate_config_store" "signature_algorithms" {
bundle = "com.pingidentity.crypto.SignatureAlgorithms"
setting_id = "signature-algorithms"
map_value = {
"DSA_SHA1" : "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
"RSA_SHA1" : "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
"RSA_SHA256" : "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
"RSA_SHA384" : "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
"RSA_SHA512" : "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
"ECDSA_SHA256" : "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"
"ECDSA_SHA384" : "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"
"ECDSA_SHA512" : "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "pingfederate_config_store" "enable_expressions" {
bundle = "org.sourceid.common.ExpressionManager"
setting_id = "evaluateExpressions"
string_value = "true"
}
5 changes: 0 additions & 5 deletions examples/resources/pingfederate_config_store/resource.tf

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions templates/resources/config_store.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ description: |-

{{ .Description | trimspace }}

## Example Usage
## Example Usage - String

{{ tffile (printf "%s%s%s" "examples/resources/" .Name "/resource.tf") }}
{{ tffile (printf "%s%s%s" "examples/resources/" .Name "/resource-string.tf") }}

## Example Usage - List

{{ tffile (printf "%s%s%s" "examples/resources/" .Name "/resource-list.tf") }}

## Example Usage - Map

{{ tffile (printf "%s%s%s" "examples/resources/" .Name "/resource-map.tf") }}

{{ .SchemaMarkdown | trimspace }}

Expand Down

0 comments on commit ec14b04

Please sign in to comment.