From 3ff199cc8033cb4e954182c6c5e18cc9bb90792d Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 29 May 2024 08:23:47 -0700 Subject: [PATCH 1/2] Add missing usage and import examples for new resources --- CHANGELOG.md | 6 ++++ docs/resources/binary_manager_builds.md | 17 +++++++++++ docs/resources/binary_manager_repos.md | 30 ++++++++++++++++++- .../xray_binary_manager_builds/import.sh | 3 ++ .../xray_binary_manager_builds/resource.tf | 4 +++ .../xray_binary_manager_repos/import.sh | 3 ++ .../xray_binary_manager_repos/resource.tf | 15 ++++++++++ 7 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 examples/resources/xray_binary_manager_builds/import.sh create mode 100644 examples/resources/xray_binary_manager_builds/resource.tf create mode 100644 examples/resources/xray_binary_manager_repos/import.sh create mode 100644 examples/resources/xray_binary_manager_repos/resource.tf diff --git a/CHANGELOG.md b/CHANGELOG.md index d93e22cf..fcee220e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.7.1 (May 29, 2024). Tested on Artifactory 7.84.12 and Xray 3.96.1 + +IMPROVEMENTS: + +* resource/xray_binary_manager_repos and resource/xray_binary_manager_builds: Add missing usage and import examples to documentation. PR: [#194](https://github.com/jfrog/terraform-provider-xray/pull/194) Issue: [#129](https://github.com/jfrog/terraform-provider-xray/issues/129) + ## 2.7.0 (May 29, 2024). Tested on Artifactory 7.84.12 and Xray 3.96.1 FEATURES: diff --git a/docs/resources/binary_manager_builds.md b/docs/resources/binary_manager_builds.md index d65f7004..5aab1590 100644 --- a/docs/resources/binary_manager_builds.md +++ b/docs/resources/binary_manager_builds.md @@ -10,7 +10,14 @@ description: |- Provides an Xray Binary Manager Builds Indexing configuration resource. See [Indexing Xray Resources](https://jfrog.com/help/r/jfrog-security-documentation/add-or-remove-resources-from-indexing) and [REST API](https://jfrog.com/help/r/xray-rest-apis/update-builds-indexing-configuration) for more details. +## Example Usage +```terraform +resource "xray_binary_manager_builds" "my-indexed-builds" { + id = "default" + indexed_builds = ["my-build-1", "my-build-2"] +} +``` ## Schema @@ -27,3 +34,13 @@ Provides an Xray Binary Manager Builds Indexing configuration resource. See [Ind ### Read-Only - `non_indexed_builds` (Set of String) Non-indexed builds for output. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import xray_binary_manager_builds.my-indexed-builds default + +terraform import xray_binary_manager_builds.my-indexed-builds default:my-project-key +``` diff --git a/docs/resources/binary_manager_repos.md b/docs/resources/binary_manager_repos.md index 9676fad0..5a5d6d37 100644 --- a/docs/resources/binary_manager_repos.md +++ b/docs/resources/binary_manager_repos.md @@ -10,7 +10,25 @@ description: |- Provides an Xray Binary Manager Repository Indexing configuration resource. See [Indexing Xray Resources](https://jfrog.com/help/r/jfrog-security-documentation/add-or-remove-resources-from-indexing) and [REST API](https://jfrog.com/help/r/xray-rest-apis/update-repos-indexing-configuration) for more details. - +## Example Usage + +```terraform +resource "xray_binary_manager_repos" "my-indexed-repos" { + id = "default" + indexed_repos = [ + { + name = "my-generic-local" + type = "local" + package_type = "Generic" + }, + { + name = "my-npm-remote" + type = "remote" + package_type = "Npm" + } + ] +} +``` ## Schema @@ -46,3 +64,13 @@ Required: - `name` (String) - `package_type` (String) - `type` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import xray_binary_manager_repos.my-indexed-repos default + +terraform import xray_binary_manager_repos.my-indexed-repos default:my-project-key +``` diff --git a/examples/resources/xray_binary_manager_builds/import.sh b/examples/resources/xray_binary_manager_builds/import.sh new file mode 100644 index 00000000..e2ffa2fe --- /dev/null +++ b/examples/resources/xray_binary_manager_builds/import.sh @@ -0,0 +1,3 @@ +terraform import xray_binary_manager_builds.my-indexed-builds default + +terraform import xray_binary_manager_builds.my-indexed-builds default:my-project-key \ No newline at end of file diff --git a/examples/resources/xray_binary_manager_builds/resource.tf b/examples/resources/xray_binary_manager_builds/resource.tf new file mode 100644 index 00000000..c6a31192 --- /dev/null +++ b/examples/resources/xray_binary_manager_builds/resource.tf @@ -0,0 +1,4 @@ +resource "xray_binary_manager_builds" "my-indexed-builds" { + id = "default" + indexed_builds = ["my-build-1", "my-build-2"] +} \ No newline at end of file diff --git a/examples/resources/xray_binary_manager_repos/import.sh b/examples/resources/xray_binary_manager_repos/import.sh new file mode 100644 index 00000000..fb3765fe --- /dev/null +++ b/examples/resources/xray_binary_manager_repos/import.sh @@ -0,0 +1,3 @@ +terraform import xray_binary_manager_repos.my-indexed-repos default + +terraform import xray_binary_manager_repos.my-indexed-repos default:my-project-key \ No newline at end of file diff --git a/examples/resources/xray_binary_manager_repos/resource.tf b/examples/resources/xray_binary_manager_repos/resource.tf new file mode 100644 index 00000000..aa95dc72 --- /dev/null +++ b/examples/resources/xray_binary_manager_repos/resource.tf @@ -0,0 +1,15 @@ +resource "xray_binary_manager_repos" "my-indexed-repos" { + id = "default" + indexed_repos = [ + { + name = "my-generic-local" + type = "local" + package_type = "Generic" + }, + { + name = "my-npm-remote" + type = "remote" + package_type = "Npm" + } + ] +} \ No newline at end of file From 0e5d3392ba0df214659bbdaeff885f1eb66f34ea Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 29 May 2024 08:24:23 -0700 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcee220e..931b933e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ IMPROVEMENTS: -* resource/xray_binary_manager_repos and resource/xray_binary_manager_builds: Add missing usage and import examples to documentation. PR: [#194](https://github.com/jfrog/terraform-provider-xray/pull/194) Issue: [#129](https://github.com/jfrog/terraform-provider-xray/issues/129) +* resource/xray_binary_manager_repos and resource/xray_binary_manager_builds: Add missing usage and import examples to documentation. PR: [#196](https://github.com/jfrog/terraform-provider-xray/pull/196) Issue: [#129](https://github.com/jfrog/terraform-provider-xray/issues/129) ## 2.7.0 (May 29, 2024). Tested on Artifactory 7.84.12 and Xray 3.96.1