From 62c64e01eb24449f75d56defae36542f5b105b3d Mon Sep 17 00:00:00 2001 From: Edhar Mocharnyk Date: Fri, 21 Jan 2022 16:24:46 +0200 Subject: [PATCH 1/3] updated CHANGELOG --- CHANGELOG.md | 11 +++++- docs/data-sources/scalr_environment.md | 4 +- docs/resources/scalr_run_triggers.md | 55 ++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 docs/resources/scalr_run_triggers.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d0cdbb5a..f9b155e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [1.0.0-rc26] - 2022-01-21 + ### Changed - **New resource:** `scalr_run_triggers` ([#102](https://github.com/Scalr/terraform-provider-scalr/pull/102)) - `data.scalr_environment`: allow to obtain scalr_environment by name ([#101](https://github.com/Scalr/terraform-provider-scalr/pull/101)) @@ -13,7 +16,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `data.scalr_environment`: added new optional attribute `name` ([#101](https://github.com/Scalr/terraform-provider-scalr/pull/101)) - `data.scalr_environment`: added new optional attribute `account_id` ([#101](https://github.com/Scalr/terraform-provider-scalr/pull/101)) +### Required + +- scalr-server >= `8.9.0` + ## [1.0.0-rc25] - 2021-11-24 + ### Changed - `data.scalr_role`: argument `account_id` is optional now ([#97](https://github.com/Scalr/terraform-provider-scalr/pull/97)) @@ -360,7 +368,8 @@ Requires Scalr 8.0.1-beta.20200625 at least - Initial release. -[Unreleased]: https://github.com/Scalr/terraform-provider-scalr/compare/v1.0.0-rc25...HEAD +[Unreleased]: https://github.com/Scalr/terraform-provider-scalr/compare/v1.0.0-rc26...HEAD +[1.0.0-rc26]: https://github.com/Scalr/terraform-provider-scalr/releases/tag/v1.0.0-rc26 [1.0.0-rc25]: https://github.com/Scalr/terraform-provider-scalr/releases/tag/v1.0.0-rc25 [1.0.0-rc24]: https://github.com/Scalr/terraform-provider-scalr/releases/tag/v1.0.0-rc24 [1.0.0-rc23]: https://github.com/Scalr/terraform-provider-scalr/releases/tag/v1.0.0-rc23 diff --git a/docs/data-sources/scalr_environment.md b/docs/data-sources/scalr_environment.md index 61860d87..b5b15b2f 100644 --- a/docs/data-sources/scalr_environment.md +++ b/docs/data-sources/scalr_environment.md @@ -14,7 +14,9 @@ This data source is used to retrieve details of a an environment. ```hcl data "scalr_environment" "test" { - id = "env-xxxxxxxxxx" + id = "env-xxxxxxxxxx" # optional, conflicts with filter by name + account_id = "acc-xxxxxxxx" # mandatory if user has access to few accounts and environment name is not unique + name = "environment-name" # optional, conflicts with filter by id } ``` diff --git a/docs/resources/scalr_run_triggers.md b/docs/resources/scalr_run_triggers.md new file mode 100644 index 00000000..8fa0a022 --- /dev/null +++ b/docs/resources/scalr_run_triggers.md @@ -0,0 +1,55 @@ +--- +layout: "scalr" +page_title: "Scalr: scalr_run_trigger" +sidebar_current: "docs-resource-scalr-run-trigger" +description: |- + Manages vcs provider. +--- + +# scalr_vcs_provider Resource + +Run triggers are a way to chain workspaces together. +The use case for this is that you might have one or more upstream workspaces that need to automatically kick off a downstream workspace based on a successful run in the upstream workspace. +To set a trigger, go to the downstream workspace and set the upstream workspace(s). +Now, whenever the upstream workspace has a successful run, the downstream workspace will automatically start a run. + +## Example Usage + +Basic usage: + +```hcl + +data "scalr_workspace" "downstream" { + name = "downstream" + environment_id = "env-xxxxxxxxx" +} + +data "scalr_workspace" "upstream" { + name = "upstream" + environment_id = "env-xxxxxxxxx" +} + +resource "scalr_run_trigger" "set_downstream" { + downstream_id = data.scalr_workspace.downstream.id # run automatically queued in this workspace once the run in upstream workspace is applied + upstream_id = data.scalr_workspace.upstream.id +} +``` + +## Argument Reference + +* `downstream_id` - (Required) The identifier of the workspace in which new runs will be created. +* `upstream_id` (Required) The identifier of the upstream workspace to track new runs. + + +## Attribute Reference + +All arguments plus: + +* `id` - The identifier of created trigger + +## Import + +To import vcs provider use vcs provider ID as the import ID. For example: +```shell +terraform import scalr_run_trigger.set_downstream rt-xxxxxxxxxx +``` From f7b31e0c5732769e285ab9131771ad53eca05391 Mon Sep 17 00:00:00 2001 From: Edhar Mocharnyk Date: Fri, 21 Jan 2022 17:16:47 +0200 Subject: [PATCH 2/3] updated scalr_run_triggers.md --- docs/resources/scalr_run_triggers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/scalr_run_triggers.md b/docs/resources/scalr_run_triggers.md index 8fa0a022..9f623a1c 100644 --- a/docs/resources/scalr_run_triggers.md +++ b/docs/resources/scalr_run_triggers.md @@ -49,7 +49,7 @@ All arguments plus: ## Import -To import vcs provider use vcs provider ID as the import ID. For example: +To import existing run trigger use its identifier. For example: ```shell terraform import scalr_run_trigger.set_downstream rt-xxxxxxxxxx ``` From f1d50f2b915774eb4976e2402f86ad89e73eb053 Mon Sep 17 00:00:00 2001 From: Edgar Mocharnyk Date: Fri, 21 Jan 2022 17:17:26 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Ryan --- docs/data-sources/scalr_environment.md | 4 ++-- docs/resources/scalr_run_triggers.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/data-sources/scalr_environment.md b/docs/data-sources/scalr_environment.md index b5b15b2f..c9231156 100644 --- a/docs/data-sources/scalr_environment.md +++ b/docs/data-sources/scalr_environment.md @@ -14,9 +14,9 @@ This data source is used to retrieve details of a an environment. ```hcl data "scalr_environment" "test" { - id = "env-xxxxxxxxxx" # optional, conflicts with filter by name + id = "env-xxxxxxxxxx" # optional, can only use id or name for the environment filter, if both are used there will be a conflict. account_id = "acc-xxxxxxxx" # mandatory if user has access to few accounts and environment name is not unique - name = "environment-name" # optional, conflicts with filter by id + name = "environment-name" # optional, can only use id or name for the environment filter, if both are used there will be a conflict. } ``` diff --git a/docs/resources/scalr_run_triggers.md b/docs/resources/scalr_run_triggers.md index 9f623a1c..fb819c55 100644 --- a/docs/resources/scalr_run_triggers.md +++ b/docs/resources/scalr_run_triggers.md @@ -30,22 +30,22 @@ data "scalr_workspace" "upstream" { } resource "scalr_run_trigger" "set_downstream" { - downstream_id = data.scalr_workspace.downstream.id # run automatically queued in this workspace once the run in upstream workspace is applied + downstream_id = data.scalr_workspace.downstream.id # run automatically triggered in this workspace once the run in the upstream workspace is applied upstream_id = data.scalr_workspace.upstream.id } ``` ## Argument Reference -* `downstream_id` - (Required) The identifier of the workspace in which new runs will be created. -* `upstream_id` (Required) The identifier of the upstream workspace to track new runs. +* `downstream_id` - (Required) The identifier of the workspace in which new runs will be triggered. +* `upstream_id` (Required) The identifier of the upstream workspace. ## Attribute Reference All arguments plus: -* `id` - The identifier of created trigger +* `id` - The identifier of the created trigger ## Import