diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 3f876040..d3369d58 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -3,7 +3,6 @@ name: default on: push: paths-ignore: - - docs/** - CHANGELOG.md - CONTRIBUTING.md - README.md @@ -16,12 +15,33 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.19" - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: version: v1.48.0 args: --timeout 2m + - name: Generate + run: go generate + - name: Validate generated code + shell: bash + run: | + if [ -z "$(git status --porcelain)" ]; then + echo "ok"; + else + echo "*** Unexpected differences after code generation. Run 'go generate' and commit."; + exit 1; + fi + + docs-preview: + name: 'Docs: preview' + needs: [lint] + uses: ./.github/workflows/rdme.yml + with: + version: '0.0.4' + dry: true + secrets: + README_API_KEY: ${{ secrets.README_API_KEY }} unit-tests: name: unit-tests @@ -30,7 +50,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.19" - name: Run unit tests run: make test @@ -51,7 +71,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.19" - name: Set API_BRANCH run: echo "API_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - name: Check if same branch exists in fatmouse repository @@ -209,7 +229,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.19" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: @@ -256,7 +276,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.19" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: @@ -278,3 +298,13 @@ jobs: gcs-bucket: ${{ secrets.BUCKET_NAME }} registry-domain: ${{ secrets.DOMAIN }} dry-run: false + + docs-publish: + name: 'Docs: publish' + needs: [ release ] + uses: ./.github/workflows/rdme.yml + with: + version: '0.0.4' + dry: false + secrets: + README_API_KEY: ${{ secrets.README_API_KEY }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..df71a485 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,25 @@ +name: '🚀 Publish the documentation' + +on: + workflow_dispatch: + inputs: + version: + description: 'Readme documentation version' + required: true + type: string + default: '0.0.4' + dry: + description: 'Perform a dry run (preview the changes without publishing)' + required: true + type: boolean + default: true + +jobs: + docs: + name: Docs + uses: ./.github/workflows/rdme.yml + with: + version: ${{ inputs.version }} + dry: ${{ inputs.dry }} + secrets: + README_API_KEY: ${{ secrets.README_API_KEY }} diff --git a/.github/workflows/rdme.yml b/.github/workflows/rdme.yml new file mode 100644 index 00000000..10dd535e --- /dev/null +++ b/.github/workflows/rdme.yml @@ -0,0 +1,33 @@ +name: '(callee) readme.io' + +on: + workflow_call: + inputs: + version: + description: 'Readme documentation version' + required: true + type: string + dry: + description: 'Perform a dry run (preview the changes without publishing)' + required: true + type: boolean + secrets: + README_API_KEY: + required: true + +jobs: + readme: + name: readme.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Preview + if: inputs.dry == true + uses: readmeio/rdme@v8 + with: + rdme: docs ./docs --key=${{ secrets.README_API_KEY }} --version=${{ inputs.version }} --dryRun + - name: Publish + if: inputs.dry == false + uses: readmeio/rdme@v8 + with: + rdme: docs ./docs --key=${{ secrets.README_API_KEY }} --version=${{ inputs.version }} diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 2fe80f60..b6ec56cf 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -49,7 +49,7 @@ jobs: run: make notify-upstream upstream_sha=${{ github.event.inputs.upstream-sha }} state=pending run_id=${{ github.run_id }} - uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.19" - name: Clone fatmouse repo uses: actions/checkout@v3 with: diff --git a/.go-version b/.go-version index cafc0b7a..c4729c87 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.18.9 +1.19.13 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9bd4ea68..affd6c0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,9 +23,15 @@ The main steps to follow when adding a resource are: - implement resource structs and CRUD methods in [Scalr Go Client](https://github.com/Scalr/go-scalr/) [^1] - pin `go-scalr` dependency to proper commit: `go get github.com/Scalr/go-scalr@` [^1] - add `scalr/resource_scalr_.go`, `scalr/datasource_scalr_.go`, implement schemas and methods + + > [!IMPORTANT] + > Always fill in the `Description` field for the resource/datasource schema and for every attribute in it + with clean and useful information. This will be collected and compiled into the documentation website. - add new resources to [provider schema](./scalr/provider.go) -- add corresponing `*_test.go` files for each new module with acceptance tests -- add new documentation: `docs/resources/scalr_.md`, `docs/data-sources/scalr_.md` following the common template [^2] +- add corresponding `*_test.go` files for each new module with acceptance tests +- add the example files for the documentation, see the `examples` folder for the reference +- if the resource needs a more complex doc page, this can be done by adding a new template in the `templates` folder +- run `go generate` command from repository root to compile the documentation - [update the changelog](#updating-the-changelog) ## Updating the changelog @@ -101,7 +107,7 @@ API object relationships in provider resource schema usually follow the rule: When in doubt, it is always a good advice to look through some good examples of existing terraform plugins, such as [terraform-provider-aws](https://github.com/hashicorp/terraform-provider-aws), [terraform-provider-auth0](https://github.com/auth0/terraform-provider-auth0), [terraform-provider-tfe](https://github.com/hashicorp/terraform-provider-tfe) -### Rules to follow [^3] +### Rules to follow [^2] - avoid using deprecated features - use context-aware function versions where it is intended (resource CRUD, etc), @@ -123,7 +129,7 @@ rather than using create or update logic which only triggers during apply - when a slice must be initialized with an empty slice instead of zero value, prefer allocating it with `make` function instead of empty slice literal (`make([]int, 0)` over `[]int{}`) - > **Note** + > [!NOTE] > When choosing the initial value for slice, take into account that zero-value slice marshals into `null`, while an empty slice will produce `[]`. - always cleanup `go.sum` after modifying project dependencies: @@ -146,5 +152,4 @@ Considering a scenario where there are two resources and each resource has a rel It can be solved by making one of these attributes `Computed` and introducing a new resource that manages the state of this relation. Refer to `scalr_provider_configuration`, `scalr_provider_configuration_default` and `scalr_environment.default_provider_configurations` for an example. [^1]: Approach will change in the future when the autogenerated API client will be introduced -[^2]: Autogenerating of the documentation is planned for implementation, the step will updated when ready -[^3]: Some advices are relevant only for SDKv2-based plugin; the migration to the Terraform Plugin Framework is already scheduled and this doc will be continiously updated and supplemented accordingly +[^2]: Some advices are relevant only for SDKv2-based plugin; the migration to the Terraform Plugin Framework is already scheduled and this doc will be continiously updated and supplemented accordingly diff --git a/README.md b/README.md index dd872d10..b8e0c7f7 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,12 @@ Follow the instructions on the [official documentation page](https://docs.scalr. ## Developing the provider ### Requirements - [Terraform](https://www.terraform.io/downloads.html) >= 0.15.x -- [Go](https://golang.org/doc/install) >= 1.18 +- [Go](https://golang.org/doc/install) >= 1.19 - [jq](https://stedolan.github.io/jq/) >= 1.0 ### Setup If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed -on your machine (version 1.18+ is *required*). +on your machine (version 1.19+ is *required*). Clone the repository: ```sh diff --git a/docs/data-sources/access_policy.md b/docs/data-sources/access_policy.md new file mode 100644 index 00000000..c3d54083 --- /dev/null +++ b/docs/data-sources/access_policy.md @@ -0,0 +1,58 @@ +--- +title: "scalr_access_policy" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_access_policy" +parentDocSlug: "provider_datasources" +hidden: false +order: 1 +--- +## Data Source Overview + +This data source is used to retrieve details of a single access policy by id. + +## Example Usage + +```terraform +data "scalr_access_policy" "example" { + id = "ap-xxxxxxxxxx" +} + +output "scope_id" { + value = data.scalr_access_policy.example.scope[0].id +} + +output "subject_id" { + value = data.scalr_access_policy.example.subject[0].id +} +``` + + +## Schema + +### Required + +- `id` (String) The access policy ID. + +### Read-Only + +- `is_system` (Boolean) +- `role_ids` (List of String) The list of the role IDs. +- `scope` (List of Object) Defines the scope where access policy is applied. (see [below for nested schema](#nestedatt--scope)) +- `subject` (List of Object) Defines the subject of the access policy. (see [below for nested schema](#nestedatt--subject)) + + +### Nested Schema for `scope` + +Read-Only: + +- `id` (String) The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace. +- `type` (String) The scope identity type, is one of `account`, `environment`, or `workspace`. + + + +### Nested Schema for `subject` + +Read-Only: + +- `id` (String) The subject ID, `user-` for user, `team-` for team, `sa-` for service account. +- `type` (String) The subject type, is one of `user`, `team`, or `service_account`. diff --git a/docs/data-sources/agent_pool.md b/docs/data-sources/agent_pool.md new file mode 100644 index 00000000..511fc867 --- /dev/null +++ b/docs/data-sources/agent_pool.md @@ -0,0 +1,40 @@ +--- +title: "scalr_agent_pool" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_agent_pool" +parentDocSlug: "provider_datasources" +hidden: false +order: 2 +--- +## Data Source Overview + +Retrieves the details of an agent pool. + +## Example Usage + +```terraform +data "scalr_agent_pool" "example1" { + id = "apool-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_agent_pool" "example2" { + name = "default-pool" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) An identifier of the Scalr account. +- `environment_id` (String) An identifier of the Scalr environment. +- `id` (String) ID of the agent pool. +- `name` (String) A name of the agent pool. +- `vcs_enabled` (Boolean) Indicates whether the VCS support is enabled for agents in the pool. + +### Read-Only + +- `workspace_ids` (List of String) The list of IDs of linked workspaces. diff --git a/docs/data-sources/current_account.md b/docs/data-sources/current_account.md new file mode 100644 index 00000000..43276581 --- /dev/null +++ b/docs/data-sources/current_account.md @@ -0,0 +1,27 @@ +--- +title: "scalr_current_account" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_current_account" +parentDocSlug: "provider_datasources" +hidden: false +order: 3 +--- +## Data Source Overview + +Retrieves the details of current account when using Scalr remote backend. + +No arguments are required. The data source returns details of the current account based on the `SCALR_ACCOUNT_ID` environment variable that is automatically exported in the Scalr remote backend. + +## Example Usage + +```terraform +data "scalr_current_account" "account" {} +``` + + +## Schema + +### Read-Only + +- `id` (String) The identifier of the account. +- `name` (String) The name of the account. diff --git a/docs/data-sources/current_run.md b/docs/data-sources/current_run.md new file mode 100644 index 00000000..cad4a9bf --- /dev/null +++ b/docs/data-sources/current_run.md @@ -0,0 +1,58 @@ +--- +title: "scalr_current_run" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_current_run" +parentDocSlug: "provider_datasources" +hidden: false +order: 4 +--- +## Data Source Overview + +Allows you to get information about the current Terraform run when using a Scalr remote backend workspace, including VCS (Git) metadata. + +No arguments are required. The data source returns details of the current run based on the `SCALR_RUN_ID` shell variable that is automatically exported in the Scalr remoted backend. + +## Example Usage + +```terraform +data "scalr_current_run" "example" {} +``` + + +## Schema + +### Read-Only + +- `environment_id` (String) The ID of the environment, in the format `env-`. +- `id` (String) The ID of the run, in the format `run-`. +- `is_destroy` (Boolean) Boolean indicates if this is a "destroy" run. +- `is_dry` (Boolean) Boolean indicates if this is a dry run, i.e. triggered by a Pull Request (PR). No apply phase if this is true. +- `message` (String) Message describing how the run was triggered. +- `source` (String) The source of the run (VCS, API, Manual). +- `vcs` (Block List) Contains details of the VCS configuration if the workspace is linked to a VCS repo. (see [below for nested schema](#nestedblock--vcs)) +- `workspace_name` (String) Workspace name. + + +### Nested Schema for `vcs` + +Read-Only: + +- `branch` (String) The linked VCS repo branch. +- `commit` (List of Object) Details of the last commit to the linked VCS repo. (see [below for nested schema](#nestedatt--vcs--commit)) +- `repository_id` (String) ID of the VCS repo in the format `:org/:repo`. + + +### Nested Schema for `vcs.commit` + +Read-Only: + +- `author` (List of Object) (see [below for nested schema](#nestedobjatt--vcs--commit--author)) +- `message` (String) +- `sha` (String) + + +### Nested Schema for `vcs.commit.author` + +Read-Only: + +- `username` (String) diff --git a/docs/data-sources/endpoint.md b/docs/data-sources/endpoint.md new file mode 100644 index 00000000..76ec923c --- /dev/null +++ b/docs/data-sources/endpoint.md @@ -0,0 +1,44 @@ +--- +title: "scalr_endpoint" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_endpoint" +parentDocSlug: "provider_datasources" +hidden: false +order: 5 +--- +## Data Source Overview + +Retrieves the details of a webhook endpoint. + +> 🚧 This datasource is deprecated and will be removed in the next major version. + +## Example Usage + +```terraform +data "scalr_endpoint" "example1" { + id = "ep-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_endpoint" "example2" { + name = "endpoint_name" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `id` (String) The endpoint ID, in the format `ep-`. +- `name` (String) Name of the endpoint. + +### Read-Only + +- `environment_id` (String) ID of the environment, in the format `env-`. +- `max_attempts` (Number) Max delivery attempts of the payload. +- `secret_key` (String, Sensitive) Secret key to sign the webhook payload. +- `timeout` (Number) Endpoint timeout (in seconds). +- `url` (String) Endpoint URL. diff --git a/docs/data-sources/environment.md b/docs/data-sources/environment.md new file mode 100644 index 00000000..d5c1eb9d --- /dev/null +++ b/docs/data-sources/environment.md @@ -0,0 +1,51 @@ +--- +title: "scalr_environment" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_environment" +parentDocSlug: "provider_datasources" +hidden: false +order: 6 +--- +## Data Source Overview + +Retrieves the details of a Scalr environment. + +## Example Usage + +```terraform +data "scalr_environment" "example1" { + id = "env-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_environment" "example2" { + name = "environment-name" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the environment account, in the format `acc-` +- `id` (String) The environment ID, in the format `env-`. +- `name` (String) Name of the environment. + +### Read-Only + +- `cost_estimation_enabled` (Boolean) Boolean indicates if cost estimation is enabled for the environment. +- `created_by` (List of Object) Details of the user that created the environment. (see [below for nested schema](#nestedatt--created_by)) +- `policy_groups` (List of String) List of the environment policy-groups IDs, in the format `pgrp-`. +- `status` (String) The status of an environment. +- `tag_ids` (List of String) List of tag IDs associated with the environment. + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) +- `full_name` (String) +- `username` (String) diff --git a/docs/data-sources/environments.md b/docs/data-sources/environments.md new file mode 100644 index 00000000..0baa04c7 --- /dev/null +++ b/docs/data-sources/environments.md @@ -0,0 +1,45 @@ +--- +title: "scalr_environments" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_environments" +parentDocSlug: "provider_datasources" +hidden: false +order: 7 +--- +## Data Source Overview + +Retrieves a list of environment ids by name or tags. + +## Example Usage + +```terraform +data "scalr_environments" "exact-names" { + name = "in:production,development" +} + +data "scalr_environments" "app-frontend" { + name = "like:app-frontend-" +} + +data "scalr_environments" "tagged" { + tag_ids = ["tag-xxxxxxxxxx", "tag-yyyyyyyyyy"] +} + +data "scalr_environments" "all" { + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `name` (String) The query used in a Scalr environment name filter. +- `tag_ids` (Set of String) List of tag IDs associated with the environment. + +### Read-Only + +- `id` (String) The ID of this resource. +- `ids` (List of String) The list of environment IDs, in the format [`env-xxxxxxxxxxx`, `env-yyyyyyyyy`]. diff --git a/docs/data-sources/iam_team.md b/docs/data-sources/iam_team.md new file mode 100644 index 00000000..69b7b377 --- /dev/null +++ b/docs/data-sources/iam_team.md @@ -0,0 +1,40 @@ +--- +title: "scalr_iam_team" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_iam_team" +parentDocSlug: "provider_datasources" +hidden: false +order: 8 +--- +## Data Source Overview + +Retrieves the details of a Scalr team. + +## Example Usage + +```terraform +data "scalr_iam_team" "example1" { + id = "team-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_iam_team" "example2" { + name = "dev" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) The identifier of the Scalr account. +- `id` (String) Identifier of the team. +- `name` (String) Name of the team. + +### Read-Only + +- `description` (String) A verbose description of the team. +- `identity_provider_id` (String) An identifier of an identity provider team is linked to, in the format `idp-`. +- `users` (List of String) The list of the user identifiers that belong to the team. diff --git a/docs/data-sources/iam_user.md b/docs/data-sources/iam_user.md new file mode 100644 index 00000000..28a1c3cb --- /dev/null +++ b/docs/data-sources/iam_user.md @@ -0,0 +1,39 @@ +--- +title: "scalr_iam_user" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_iam_user" +parentDocSlug: "provider_datasources" +hidden: false +order: 9 +--- +## Data Source Overview + +Retrieves the details of a Scalr user. + +## Example Usage + +```terraform +data "scalr_iam_user" "example1" { + id = "user-xxxxxxxxxx" +} + +data "scalr_iam_user" "example2" { + email = "user@test.com" +} +``` + + +## Schema + +### Optional + +- `email` (String) An email of a user. +- `id` (String) An identifier of a user. + +### Read-Only + +- `full_name` (String) A full name of the user. +- `identity_providers` (List of String) A list of the identity providers the user belongs to. +- `status` (String) A system status of the user. +- `teams` (List of String) A list of the team identifiers the user belongs to. +- `username` (String) A username of the user. diff --git a/docs/data-sources/module_version.md b/docs/data-sources/module_version.md new file mode 100644 index 00000000..4ffc6aa1 --- /dev/null +++ b/docs/data-sources/module_version.md @@ -0,0 +1,35 @@ +--- +title: "scalr_module_version" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_module_version" +parentDocSlug: "provider_datasources" +hidden: false +order: 10 +--- +## Data Source Overview + +Retrieves the module version data by module source and semantic version. + +## Example Usage + +```terraform +data "scalr_module_version" "example" { + source = "env-xxxxxxxxxx/resource-name/scalr" + version = "1.0.0" +} +``` + + +## Schema + +### Required + +- `source` (String) The module source. + +### Optional + +- `version` (String) The semantic version. If omitted, the latest module version is selected + +### Read-Only + +- `id` (String) The identifier of а module version. Example: `modver-xxxx` diff --git a/docs/data-sources/policy_group.md b/docs/data-sources/policy_group.md new file mode 100644 index 00000000..3de52cb8 --- /dev/null +++ b/docs/data-sources/policy_group.md @@ -0,0 +1,63 @@ +--- +title: "scalr_policy_group" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_policy_group" +parentDocSlug: "provider_datasources" +hidden: false +order: 11 +--- +## Data Source Overview + +Retrieves the details of a policy group. + +## Example Usage + +```terraform +data "scalr_policy_group" "example1" { + id = "pgrp-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_policy_group" "example2" { + name = "instance_types" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) The identifier of the Scalr account. +- `id` (String) The identifier of a policy group. +- `name` (String) The name of a policy group. + +### Read-Only + +- `environments` (List of String) A list of the environments the policy group is linked to. +- `error_message` (String) An error details if Scalr failed to process the policy group. +- `opa_version` (String) The version of the Open Policy Agent that the policy group is using. +- `policies` (List of Object) A list of the OPA policies the policy group verifies each run. (see [below for nested schema](#nestedatt--policies)) +- `status` (String) A system status of the policy group. +- `vcs_provider_id` (String) The VCS provider identifier for the repository where the policy group resides. In the format `vcs-`. +- `vcs_repo` (List of Object) Contains VCS-related meta-data for the policy group. (see [below for nested schema](#nestedatt--vcs_repo)) + + +### Nested Schema for `policies` + +Read-Only: + +- `enabled` (Boolean) If set to `false`, the policy will not be verified on a run. +- `enforced_level` (String) An enforcement level of a policy. +- `name` (String) A name of a policy. + + + +### Nested Schema for `vcs_repo` + +Read-Only: + +- `branch` (String) A branch of a repository the policy group is associated with. +- `identifier` (String) A reference to the VCS repository in the format `:org/:repo`, it stands for the organization and repository. +- `path` (String) A subdirectory of a VCS repository where OPA policies are stored. diff --git a/docs/data-sources/provider_configuration.md b/docs/data-sources/provider_configuration.md new file mode 100644 index 00000000..e7c37d86 --- /dev/null +++ b/docs/data-sources/provider_configuration.md @@ -0,0 +1,37 @@ +--- +title: "scalr_provider_configuration" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_provider_configuration" +parentDocSlug: "provider_datasources" +hidden: false +order: 12 +--- +## Data Source Overview + +Retrieves information about a single provider configuration. + +## Example Usage + +```terraform +data "scalr_provider_configuration" "aws" { + id = "pcfg-xxxxxxxxxx" +} + +data "scalr_provider_configuration" "aws_dev" { + name = "aws_dev" +} + +data "scalr_provider_configuration" "azure" { + provider_name = "azurerm" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) The identifier of the Scalr account, in the format `acc-`. +- `id` (String) The provider configuration ID, in the format `pcfg-xxxxxxxxxxx`. +- `name` (String) The name of a Scalr provider configuration. +- `provider_name` (String) The name of a Terraform provider. diff --git a/docs/data-sources/provider_configurations.md b/docs/data-sources/provider_configurations.md new file mode 100644 index 00000000..b1b7fc90 --- /dev/null +++ b/docs/data-sources/provider_configurations.md @@ -0,0 +1,37 @@ +--- +title: "scalr_provider_configurations" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_provider_configurations" +parentDocSlug: "provider_datasources" +hidden: false +order: 13 +--- +## Data Source Overview + +Retrieves a list of provider configuration ids by name or type. + +## Example Usage + +```terraform +data "scalr_provider_configurations" "aws" { + name = "in:aws_dev,aws_demo,aws_prod" +} + +data "scalr_provider_configurations" "google" { + provider_name = "google" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) The identifier of the Scalr account, in the format `acc-`. +- `name` (String) The query used in a Scalr provider configuration name filter. +- `provider_name` (String) The name of a Terraform provider. + +### Read-Only + +- `id` (String) The ID of this resource. +- `ids` (List of String) The list of provider configuration IDs, in the format [`pcfg-xxxxxxxxxxx`, `pcfg-yyyyyyyyy`]. diff --git a/docs/data-sources/role.md b/docs/data-sources/role.md new file mode 100644 index 00000000..3f188505 --- /dev/null +++ b/docs/data-sources/role.md @@ -0,0 +1,48 @@ +--- +title: "scalr_role" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_role" +parentDocSlug: "provider_datasources" +hidden: false +order: 14 +--- +## Data Source Overview + +This data source is used to retrieve details of a single role. + +## Example Usage + +```terraform +# To retrieve a custom role, an account id and role id (or name) are required: + +data "scalr_role" "example1" { + id = "role-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_role" "example2" { + name = "WorkspaceAdmin" + account_id = "acc-xxxxxxxxxx" +} + +# To retrieve system-managed roles an account id has to be omitted: + +data "scalr_role" "example3" { + name = "user" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account. +- `id` (String) ID of the role. +- `name` (String) Name of the role. + +### Read-Only + +- `description` (String) Verbose description of the role. +- `is_system` (Boolean) Boolean indicates if the role can be edited. +- `permissions` (List of String) Array of permission names. diff --git a/docs/data-sources/scalr_access_policy.md b/docs/data-sources/scalr_access_policy.md deleted file mode 100644 index 31db96b7..00000000 --- a/docs/data-sources/scalr_access_policy.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -layout: "scalr" -page_title: "Scalr: scalr_access_policy" -sidebar_current: "docs-datasource-scalr-access-policy-x" -description: |- - Get information on a IAM access policy. ---- - -# scalr_access_policy Data Source - -This data source is used to retrieve details of a single access policy by id. - -## Example Usage - -```hcl -data "scalr_access_policy" "example" { - id = "ap-xxxxxxxxx" -} - -output "scope_id" { - value = data.scalr_access_policy.example.scope[0].id -} - -output "subject_id" { - value = data.scalr_access_policy.example.subject[0].id -} -``` - -## Argument Reference - -The following arguments are supported: - -* `id` - The access policy ID. - -## Attribute Reference - -All arguments plus: - -* `scope` - Defines the scope where access policy is applied. -* `subject` - Defines the subject of the access policy. -* `role_ids` - The list of the role IDs. - -The `scope` block contains: - -* `type` - The scope identity type, is one of `account`, `environment`, or `workspace`. -* `id` - The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace. - -The `subject` block contains: - -* `type` - The subject type, is one of `user`, `team`, or `service_account`. -* `id` - The subject ID, `user-` for user, `team-` for team, `sa-` for service account. diff --git a/docs/data-sources/scalr_agent_pool.md b/docs/data-sources/scalr_agent_pool.md deleted file mode 100644 index b7292f3f..00000000 --- a/docs/data-sources/scalr_agent_pool.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Data Source `scalr_agent_pool` - -Retrieves the details of an agent pool. - -## Example Usage - -Basic usage: - -```hcl -data "scalr_agent_pool" "default" { - id = "apool-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_agent_pool" "default" { - name = "default-pool" - account_id = "acc-xxxxxxx" -} -``` - -## Argument Reference - -* `id` - (Optional) ID of the agent pool. -* `name` - (Optional) A name of the agent pool. -* `account_id` - (Optional) An identifier of the Scalr account. -* `environment_id` - (Optional) An identifier of the Scalr environment. -* `vcs_enabled` - (Optional) Indicates whether the VCS support is enabled for agents in the pool. - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_agent_pool`. - -## Attribute Reference - -All arguments plus: - -* `workspace_ids` - The list of IDs of linked workspaces. \ No newline at end of file diff --git a/docs/data-sources/scalr_current_account.md b/docs/data-sources/scalr_current_account.md deleted file mode 100644 index 823fd4c0..00000000 --- a/docs/data-sources/scalr_current_account.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Data Source `scalr_current_account` - -Retrieves the details of current account when using Scalr remote backend. - -## Example Usage - -```hcl -data "scalr_current_account" "account" {} -``` - -## Argument Reference - -No arguments are required. The data source returns details of the current account -based on the `SCALR_ACCOUNT_ID` environment variable that is automatically exported in the Scalr remote backend. - -## Attribute Reference - -* `id` - The identifier of the account. -* `name` - The name of the account. diff --git a/docs/data-sources/scalr_current_run.md b/docs/data-sources/scalr_current_run.md deleted file mode 100644 index d143e4d9..00000000 --- a/docs/data-sources/scalr_current_run.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Data Source `scalr_current_run` - -Allows you to get information about the current Terraform run when using a Scalr remote backend workspace, including VCS (Git) metadata. - -## Example Usage - -```hcl -data scalr_current_run example { -} -``` - -## Argument Reference - -No arguments are required. The data source returns details of the current run based on the `SCALR_RUN_ID` shell variable that is automatically exported in the Scalr remoted backend. -If the shell variable is not present (e.g. during a local run) an empty run structure will be returned with the `id` attribute set to "-". - -## Attribute Reference - -* `id` - The ID of the run, in the format `run-` -* `environment_id` - The ID of the environment, in the format `env-` -* `workspace_name` - Workspace name. -* `vcs` - Contains details of the VCS configuration if the workspace is linked to a VCS repo. -* `is_destroy` - Boolean indicates if this is a "destroy" run. -* `is_dry` - Boolean indicates if this is a dry run, i.e. triggered by a Pull Request (PR). No apply phase if this is true. -* `message` - Message describing how the run was triggered -* `source` - The source of the run (VCS, API, Manual). - -The `vcs` block contains: - -* `repository_id` - ID of the VCS repo in the for `:org/:repo`. -* `branch` - The linked VCS repo branch. -* `commit` - Details of the last commit to the linked VCS repo. - -The `vcs.commit` block contains: - -* `message` - Message for the last commit. -* `sha` - SHA of the last commit. -* `author` - Details of the author of the last commit. - -The `vcs.commit.author` block contains: - -* `email` - email_address of the author in the VCS. -* `name` - Name of the author in the VCS. -* `username` - Username of the author in the VCS. diff --git a/docs/data-sources/scalr_endpoint.md b/docs/data-sources/scalr_endpoint.md deleted file mode 100644 index fdbfae7e..00000000 --- a/docs/data-sources/scalr_endpoint.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Data Source `scalr_endpoint` - -Retrieves the details of a webhook endpoint. - -> **WARNING:** This datasource is deprecated and will be removed in the next major version. - -## Example Usage - -```hcl -data "scalr_endpoint" "example" { - id = "ep-xxxxxxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_endpoint" "example" { - name = "endpoint_name" - account_id = "acc-xxxxxxx" -} -``` - -## Argument Reference - -* `id` - (Optional) The endpoint ID, in the format `ep-`. -* `name` - (Optional) Name of the endpoint. -* `account_id` - (Optional) ID of the account, in the format `acc-` - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_endpoint`. - -## Attribute Reference - -All arguments plus: - -* `secret_key` - Secret key to sign the webhook payload. -* `url` - Endpoint URL. -* `max_attempts` - Max delivery attempts of the payload. -* `environment_id` - ID of the environment, in the format `env-`. -* `timeout` - Endpoint timeout (in seconds). \ No newline at end of file diff --git a/docs/data-sources/scalr_environment.md b/docs/data-sources/scalr_environment.md deleted file mode 100644 index 637f5d61..00000000 --- a/docs/data-sources/scalr_environment.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Data Source `scalr_environment` - -Retrieves the details of a Scalr environment. - -## Example Usage - -```hcl -data "scalr_environment" "test" { - id = "env-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_environment" "test" { - name = "environment-name" - account_id = "acc-xxxxxxx" -} -``` - -## Arguments - -* `id` - (Optional) The environment ID, in the format `env-`. -* `name` - (Optional) Name of the environment. -* `account_id` - (Optional) ID of the environment account, in the format `acc-` - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_environment`. - -## Attributes - -All arguments plus: - -* `created_by` - Details of the user that created the environment. -* `cost_estimation_enabled` - Boolean indicates if cost estimation is enabled for the environment. -* `status` - The status of an environment. -* `policy_groups` - List of the environment policy-groups IDs, in the format `pgrp-`. -* `tag_ids` - List of tag IDs associated with the environment. - -The `created_by` block contains: - -* `username` - Username of creator. -* `email` - Email address of creator. -* `full_name` - Full name of creator. diff --git a/docs/data-sources/scalr_environments.md b/docs/data-sources/scalr_environments.md deleted file mode 100644 index aa99fb79..00000000 --- a/docs/data-sources/scalr_environments.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Data Source `scalr_environments` - -Retrieves a list of environment ids by name or tags. - -## Example Usage - -```hcl -data "scalr_environments" "exact-names" { - name = "in:production,development" -} - -data "scalr_environments" "app-frontend" { - name = "like:app-frontend-" -} - -data "scalr_environments" "tagged" { - tag_ids = ["tag-xxxxxxxxxxx", "tag-yyyyyyyyyyy"] -} - -data "scalr_environments" "all" { - account_id = "acc-xxxxxxxxxxx" -} -``` - -## Argument Reference - -* `account_id` - (Optional) ID of the account, in the format `acc-`. -* `name` - (Optional) The query used in a Scalr environment name filter. -* `tag_ids` - (Optional) List of tag IDs associated with the environment. - -## Attribute Reference - -All arguments plus: - -* `ids` - The list of environment IDs, in the format [`env-xxxxxxxxxxx`, `env-yyyyyyyyy`]. diff --git a/docs/data-sources/scalr_iam_team.md b/docs/data-sources/scalr_iam_team.md deleted file mode 100644 index 99fb0eed..00000000 --- a/docs/data-sources/scalr_iam_team.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Data Source `scalr_iam_team` - -Retrieves the details of a Scalr team. - -## Example Usage - -```hcl -data "scalr_iam_team" "example" { - id = "team-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_iam_team" "example" { - name = "dev" - account_id = "acc-xxxxxxx" -} -``` - -## Argument Reference - -* `id` - (Optional) Identifier of the team. -* `name` - (Optional) Name of the team. -* `account_id` - (Optional) The identifier of the Scalr account. - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_iam_team`. - -## Attribute Reference - -All arguments plus: - -* `description` - A verbose description of the team. -* `identity_provider_id` - An identifier of an identity provider team is linked to, in the format `idp-`. -* `users` - The list of the user identifiers that belong to the team. diff --git a/docs/data-sources/scalr_iam_user.md b/docs/data-sources/scalr_iam_user.md deleted file mode 100644 index 8f2782d0..00000000 --- a/docs/data-sources/scalr_iam_user.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Data Source `scalr_iam_user` - -Retrieves the details of a Scalr user. - -## Example Usage - -```hcl -data "scalr_iam_user" "example" { - id = "user-xxxxxxx" -} -``` - -```hcl -data "scalr_iam_user" "example" { - email = "user@test.com" -} -``` - -## Argument Reference - -* `id` - (Optional) An identifier of a user. -* `email` - (Optional) An email of a user. - -Arguments `id` and `email` are both optional, specify at least one of them to obtain `scalr_iam_user`. - -## Attribute Reference - -All arguments plus: - -* `status` - A system status of the user. -* `username` - A username of the user. -* `full_name` - A full name of the user. -* `identity_providers` - A list of the identity providers the user belongs to. -* `teams` - A list of the team identifiers the user belongs to. diff --git a/docs/data-sources/scalr_module_version.md b/docs/data-sources/scalr_module_version.md deleted file mode 100644 index df435875..00000000 --- a/docs/data-sources/scalr_module_version.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Data Source `scalr_module_version` - -Retrieves the module version data by module source and semantic version. - -## Example Usage - -```hcl -data "scalr_module_version" "example" { - source = "env-xxxxxx/resource-name/scalr" - version = "1.0.0" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `source` - (Required) The module source. -* `version` - (Optional) The semantic version based on module version was created. - -## Attribute Reference - -All arguments plus: - -* `id` - The identifier of а module version. Example: `modver-xxxx` diff --git a/docs/data-sources/scalr_policy_group.md b/docs/data-sources/scalr_policy_group.md deleted file mode 100644 index 074172a6..00000000 --- a/docs/data-sources/scalr_policy_group.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Data Source `scalr_policy_group` - -Retrieves the details of a policy group. - -## Example Usage - -```hcl -data "scalr_policy_group" "example" { - id = "pgrp-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_policy_group" "example" { - name = "instance_types" - account_id = "acc-xxxxxxx" -} -``` - -## Argument Reference - -* `id` - (Optional) The identifier of a policy group. -* `name` - (Optional) The name of a policy group. -* `account_id` - (Optional) The identifier of the Scalr account. - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_policy_group`. - -## Attribute Reference - -All arguments plus: - -* `status` - A system status of the policy group. -* `error_message` - An error details if Scalr failed to process the policy group. -* `opa_version` - The version of the Open Policy Agent that the policy group is using. -* `vcs_provider_id` - The VCS provider identifier for the repository where the policy group resides. In the format `vcs-`. -* `vcs_repo` - Contains VCS-related meta-data for the policy group. -* `policies` - A list of the OPA policies the policy group verifies each run. -* `environments` - A list of the environments the policy group is linked to. - -The `vcs_repo` object contains: - -* `identifier` - A reference to the VCS repository in the format `:org/:repo`, it stands for the organization and repository. -* `branch` - A branch of a repository the policy group is associated with. -* `path` - A subdirectory of a VCS repository where OPA policies are stored. - -A `policies` list contains definitions of OPA policies in the following form: - -* `name` - A name of a policy. -* `enabled` - If set to `false`, the policy will not be verified on a run. -* `enforced_level` - An enforcement level of a policy. diff --git a/docs/data-sources/scalr_provider_configuration.md b/docs/data-sources/scalr_provider_configuration.md deleted file mode 100644 index 1a1db791..00000000 --- a/docs/data-sources/scalr_provider_configuration.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Data Source `scalr_provider_configuration` - -Retrieves information about a single provider configuration. - -## Example Usage - -```hcl -data "scalr_provider_configuration" "aws_dev" { - id = "pcfg-xxxxxxx" -} -``` - -```hcl -data "scalr_provider_configuration" "aws_dev" { - name = "aws_dev" -} -``` - -```hcl -data "scalr_provider_configuration" "azure" { - provider_name = "azurerm" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `id` - (Optional) The provider configuration ID, in the format `pcfg-xxxxxxxxxxx`. -* `name` - (Optional) The name of a Scalr provider configuration. -* `provider_name` - (Optional) The name of a Terraform provider. -* `account_id` - (Optional) The identifier of the Scalr account, in the format `acc-`. - -## Attribute Reference - -Attributes are the same as arguments. diff --git a/docs/data-sources/scalr_provider_configurations.md b/docs/data-sources/scalr_provider_configurations.md deleted file mode 100644 index 86a87c7b..00000000 --- a/docs/data-sources/scalr_provider_configurations.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Data Source `scalr_provider_configurations` - -Retrieves a list of provider configuration ids by name or type. - -## Example Usage - -```hcl -data "scalr_provider_configurations" "aws" { - name = "in:aws_dev,aws_demo,aws_prod" -} - -data "scalr_provider_configurations" "google" { - provider_name = "google" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` - (Optional) The query used in a Scalr provider configuration name filter. -* `provider_name` - (Optional) The name of a Terraform provider. -* `account_id` - (Optional) The identifier of the Scalr account, in the format `acc-`. - -## Attribute Reference - -All arguments plus: - -* `ids` - The list of provider configuration IDs, in the format [`pcfg-xxxxxxxxxxx`, `pcfg-yyyyyyyyy`]. \ No newline at end of file diff --git a/docs/data-sources/scalr_role.md b/docs/data-sources/scalr_role.md deleted file mode 100644 index 64153a19..00000000 --- a/docs/data-sources/scalr_role.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Data Source `scalr_role` - -This data source is used to retrieve details of a single role. - -## Example Usage - -To retrieve a custom role, an account id and role id (or name) are required, for example: - -```hcl -data "scalr_role" "example" { - id = "role-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_role" "example" { - name = "WorkspaceAdmin" - account_id = "acc-xxxxxxx" -} -``` - -To retrieve system-managed roles an account id has to be omitted, for example: - -```hcl -data "scalr_role" "example" { - name = "user" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `id` - (Optional) ID of the role. -* `name` - (Optional) Name of the role. -* `account_id` - (Optional) ID of the account. - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_role`. - -## Attribute Reference - -All arguments plus: - -* `permissions` - Array of permission names. -* `is_system` - Boolean indicates if the role can be edited. -* `description` - Verbose description of the role. diff --git a/docs/data-sources/scalr_service_account.md b/docs/data-sources/scalr_service_account.md deleted file mode 100644 index d118d88a..00000000 --- a/docs/data-sources/scalr_service_account.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Data Source `scalr_service_account` - -Retrieves information about a service account. - -## Example Usage - -```hcl -data "scalr_service_account" "example" { - id = "sa-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_service_account" "example" { - email = "name@account.scalr.io" - account_id = "acc-xxxxxxx" -} -``` - -## Arguments - -* `id` - (Optional) The identifier of the service account in the format `sa-`. -* `email` - (Optional) The email of the service account. -* `account_id` - (Optional) ID of the account, in the format `acc-`. - -Arguments `id` and `email` are both optional, specify at least one of them to obtain `scalr_service_account`. - -## Attributes - -All arguments plus: - -* `name` - Name of the service account. -* `description` - Description of the service account. -* `status` - The status of the service account. -* `created_by` - Details of the user that created the service account. - -The `created_by` block contains: - -* `username` - Username of creator. -* `email` - Email address of creator. -* `full_name` - Full name of creator. diff --git a/docs/data-sources/scalr_tag.md b/docs/data-sources/scalr_tag.md deleted file mode 100644 index f78a062d..00000000 --- a/docs/data-sources/scalr_tag.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Data Source `scalr_tag` - -Retrieves information about a tag. - -## Example Usage - -```hcl -data "scalr_tag" "example" { - id = "tag-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_tag" "example" { - name = "tag-name" - account_id = "acc-xxxxxxx" -} -``` - -## Arguments - -* `id` - (Optional) The identifier of the tag in the format `tag-`. -* `name` - (Optional) The name of the tag. -* `account_id` - (Optional) The ID of the Scalr account, in the format `acc-`. - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_tag`. - -## Attributes - -Attributes are the same as arguments. diff --git a/docs/data-sources/scalr_variable.md b/docs/data-sources/scalr_variable.md deleted file mode 100644 index 2169855b..00000000 --- a/docs/data-sources/scalr_variable.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Data Source `scalr_variable` - -Retrieves the details of a variable. - -## Example Usage - -```hcl -data "scalr_variable" "test_var" { - id = "var-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_variable" "test_var" { - key = "key" - category = "terraform" - account_id = "acc-xxxxxxx" - environment_id = "env-xxxxxxx" - workspace_id = "ws-xxxxxxx" -} -``` - -## Argument Reference - -* `id` - (Optional) ID of a Scalr variable. -* `key` - (Optional) The name of a Scalr variable. -* `category` - (Optional) The category of a Scalr variable. -* `account_id` - (Optional) ID of the account, in the format `acc-` -* `environment_id` - (Optional) The identifier of the Scalr environment, in the format `env-`. Used to shrink the scope of the variable in case the variable name exists in multiple environments. -* `workspace_id` - (Optional) The identifier of the Scalr workspace, in the format `ws-`. Used to shrink the scope of the variable in case the variable name exists on multiple workspaces. - -Arguments `id` and `key` are both optional, specify at least one of them to obtain `scalr_variable`. - - -## Attribute Reference - -All arguments plus: - -* `value` - Variable value. -* `description` - Variable verbose description, defaults to empty string. -* `hcl` - If the variable is configured as a string of HCL code. -* `sensitive` - If the variable is configured as sensitive. -* `final` - If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. diff --git a/docs/data-sources/scalr_variables.md b/docs/data-sources/scalr_variables.md deleted file mode 100644 index a052ba32..00000000 --- a/docs/data-sources/scalr_variables.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Data Source `scalr_variables` - -Retrieves the list of variables by the given filters. - -## Example Usage - -```hcl -data "scalr_variables" "vars" { - keys = ["key1", "key2", "key3"] - category = "terraform" # or shell - account_id = "acc-tgobtsrgo3rlks8" - envrironment_ids = ["env-sv0425034857d22", "null"] - workspace_ids = ["ws-tlbp7litrs55vgg", "null"] -} -``` - -## Argument Reference - -* `keys` - (Optional) A list of keys to be used in the query used in a Scalr variable name filter. -* `category` - (Optional) The category of a Scalr variable. -* `account_id` - (Optional) ID of the account, in the format `acc-` -* `envrironment_ids` - (Optional) A list of identifiers of the Scalr environments, in the format `env-`. Used to shrink the variable's scope in case the variable name exists in multiple environments. -* `workspace_ids` - (Optional) A list of identifiers of the Scalr workspace, in the format `ws-`. Used to shrink the variable's scope in case the variable name exists on multiple workspaces. - - -## Attribute Reference - - -* `variables` - The list of Scalr variables with all attributes. - -The `variables` block item contains: - -* `id` - ID of the variable. -* `key` - Key of the variable. -* `value` - Variable value if it is not sensitive. -* `category` - Indicates if this is a Terraform or shell variable. -* `description` - Variable verbose description. -* `hcl` - If the variable is configured as a string of HCL code. -* `sensitive` - If the variable is configured as sensitive. -* `final` - If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. -* `workspace_id` - The workspace that owns the variable, specified as an ID, in the format `ws-`. -* `environment_id` - The environment that owns the variable, specified as an ID, in the format `env-`. -* `account_id` - The account that owns the variable, specified as an ID, in the format `acc-`. diff --git a/docs/data-sources/scalr_vcs_provider.md b/docs/data-sources/scalr_vcs_provider.md deleted file mode 100644 index a5160cfc..00000000 --- a/docs/data-sources/scalr_vcs_provider.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Data Source `scalr_vcs_provider` - -Retrieves the details of a VCS provider. - -## Example Usage - -```hcl -data "scalr_vcs_provider" "example" { - id = "vcs-xxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_vcs_provider" "example" { - name = "example" - account_id = "acc-xxx" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `id` - (Optional) Identifier of the VCS provider. -* `name` - (Optional) Name of the VCS provider. -* `vcs_type` - (Optional) Type of the VCS provider. For example, `github`. -* `environment_id` - (Optional) ID of the environment the VCS provider has to be linked to, in the format `env-`. -* `account_id` - (Optional) ID of the account, in the format `acc-`. -* `agent_pool_id` - (Optional) The id of the agent pool to connect Scalr to self-hosted VCS provider, in the format `apool-`. - -## Attribute Reference - -All arguments plus: - -* `url` - The URL to the VCS provider installation. -* `environments` - List of the identifiers of environments the VCS provider is linked to. diff --git a/docs/data-sources/scalr_webhook.md b/docs/data-sources/scalr_webhook.md deleted file mode 100644 index 3afb2b0a..00000000 --- a/docs/data-sources/scalr_webhook.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Data Source `scalr_webhook` - -Retrieves the details of a webhook. - -## Example Usage - -```hcl -data "scalr_webhook" "example" { - id = "wh-xxxxxxxxxxx" - account_id = "acc-xxxxxxx" -} -``` - -```hcl -data "scalr_webhook" "example" { - name = "webhook_name" - account_id = "acc-xxxxxxx" -} -``` - -## Argument Reference - -* `id` - (Optional) The webhook ID, in the format `wh-`. -* `name` - (Optional) Name of the webhook. -* `account_id` - (Optional) ID of the account, in the format `acc-` - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_webhook`. - -## Attribute Reference - -All arguments plus: - -* `enabled` - Boolean indicates if the webhook is enabled. -* `endpoint_id` - (Deprecated) ID of the endpoint, in the format `ep-`. -* `environment_id` - (Deprecated) ID of the environment, in the format `env-`. -* `workspace_id` - (Deprecated) ID of the workspace, in the format `ws-`. -* `events` - List of event IDs. -* `last_triggered_at` - Date/time when webhook was last triggered. -* `url` - Endpoint URL. -* `secret_key` - Secret key to sign the webhook payload. -* `max_attempts` - Max delivery attempts of the payload. -* `timeout` - Endpoint timeout (in seconds). -* `environments` - The list of environment identifiers that the webhook is shared to, -or `["*"]` if shared with all environments. -* `header` - (Set of header objects) Additional headers to set in the webhook request. - The `header` block item contains: - * `name` - The name of the header. - * `value` - The value of the header. diff --git a/docs/data-sources/scalr_workspace.md b/docs/data-sources/scalr_workspace.md deleted file mode 100644 index 282de95c..00000000 --- a/docs/data-sources/scalr_workspace.md +++ /dev/null @@ -1,79 +0,0 @@ - -# Data Source `scalr_workspace` - -Retrieves the details of a single workspace. - -## Example Usage - -```hcl -data "scalr_workspace" "example" { - id = "ws-xxxxxxx" - environment_id = "env-xxxxxxx" -} -``` - -```hcl -data "scalr_workspace" "example" { - name = "my-workspace-name" - environment_id = "env-xxxxxxx" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `id` - (Optional) ID of the workspace. -* `name` - (Optional) Name of the workspace. -* `environment_id` - (Required) ID of the environment, in the format `env-`. - -Arguments `id` and `name` are both optional, specify at least one of them to obtain `scalr_workspace`. - -## Attribute Reference - -All arguments plus: - -* `auto_apply` - Boolean indicates if `terraform apply` will be automatically run when `terraform plan` ends without error. -* `force_latest_run` - Boolean indicates if latest new run will be automatically raised in priority. -* `operations` - Boolean indicates if the workspace is being used for remote execution. -* `execution_mode` - Execution mode of the workspace. -* `terraform_version` - The version of Terraform used for this workspace. -* `working_directory` - A relative path that Terraform will execute within. -* `run_operation_timeout` - The number of minutes run operation can be executed before termination. -* `module_version_id` - The identifier of a module version in the format `modver-`. -* `tag_ids` - List of tag IDs associated with the workspace. -* `vcs_provider_id` - The identifier of a VCS provider in the format `vcs-`. -* `vcs_repo` - If a workspace is linked to a VCS repository this block shows the details, otherwise `{}` -* `created_by` - Details of the user that created the workspace. -* `has_resources` - The presence of active terraform resources in the current state version. -* `deletion_protection_enabled` - Boolean, indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed. -* `auto_queue_runs` - Indicates if runs have to be queued automatically when a new configuration version is uploaded. - - Supported values are `skip_first`, `always`, `never`: - - * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior. - * `always` - runs will be triggered automatically on every upload of the configuration version. - * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered. - -* `hooks` - List of custom hooks in a workspace. - - The `hooks` block supports: - - * `pre_init` - Script or action configured to call before init phase - * `pre_plan` - Script or action configured to call before plan phase - * `post_plan` - Script or action configured to call after plan phase - * `pre_apply` - Script or action configured to call before apply phase - * `post_apply` - Script or action configured to call after apply phase - -The `vcs_repo` block contains: - -* `identifier` - * The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider. -* `path` - Path within the repo, if any. -* `dry_runs_enabled` - Boolean indicates the VCS-driven dry runs should run when the pull request to the configuration versions branch is created. -* `ingress_submodules` - Designates whether to clone git submodules of the VCS repository. - -The `created_by` block contains: - -* `username` - Username of creator. -* `email` - Email address of creator. -* `full_name` - Full name of creator. diff --git a/docs/data-sources/scalr_workspace_ids.md b/docs/data-sources/scalr_workspace_ids.md deleted file mode 100644 index d35dba67..00000000 --- a/docs/data-sources/scalr_workspace_ids.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Data Source `scalr_workspace_ids` - -Retrieves a map of workspace IDs based on the names provided. Wildcards are accepted. - -## Example Usage - -```hcl -data "scalr_workspace_ids" "app-frontend" { - names = ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"] - environment_id = "env-xxxxxxxxxxx" -} - -data "scalr_workspace_ids" "all" { - names = ["*"] - environment_id = "env-xxxxxxxxxxx" -} -``` - -## Argument Reference - -* `names` - (Required) * A list of names to search for. If a name does not exist, it will not throw an error, it will just not exist in the returned output. Use `["*"]` to select all workspaces. -* `environment_id` - (Required) ID of the environment, in the format `env-`. - -## Attribute Reference - -All arguments plus: - -* `ids` - A map of workspace names and their opaque IDs, in the format `env_id/name`. diff --git a/docs/data-sources/scalr_workspaces.md b/docs/data-sources/scalr_workspaces.md deleted file mode 100644 index a1acddd9..00000000 --- a/docs/data-sources/scalr_workspaces.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Data Source `scalr_workspaces` - -Retrieves a list of workspace ids by name or tags. - -## Example Usage - -```hcl -data "scalr_workspaces" "exact-names" { - name = "in:production,development" -} - -data "scalr_workspaces" "app-frontend" { - name = "like:app-frontend-" - environment_id = "env-xxxxxxxxxxx" -} - -data "scalr_workspaces" "tagged" { - tag_ids = ["tag-xxxxxxxxxxx", "tag-yyyyyyyyyyy"] -} - -data "scalr_workspaces" "all" { - environment_id = "env-xxxxxxxxxxx" -} -``` - -## Argument Reference - -* `account_id` - (Optional) ID of the account, in the format `acc-`. -* `environment_id` - (Optional) ID of the environment, in the format `env-`. -* `name` - (Optional) The query used in a Scalr workspace name filter. -* `tag_ids` - (Optional) List of tag IDs associated with the workspace. - -## Attribute Reference - -All arguments plus: - -* `ids` - The list of workspace IDs, in the format [`ws-xxxxxxxxxxx`, `ws-yyyyyyyyy`]. diff --git a/docs/data-sources/service_account.md b/docs/data-sources/service_account.md new file mode 100644 index 00000000..d6080b89 --- /dev/null +++ b/docs/data-sources/service_account.md @@ -0,0 +1,50 @@ +--- +title: "scalr_service_account" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_service_account" +parentDocSlug: "provider_datasources" +hidden: false +order: 15 +--- +## Data Source Overview + +Retrieves information about a service account. + +## Example Usage + +```terraform +data "scalr_service_account" "example1" { + id = "sa-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_service_account" "example2" { + email = "name@account.scalr.io" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `email` (String) The email of the service account. +- `id` (String) The identifier of the service account in the format `sa-`. + +### Read-Only + +- `created_by` (List of Object) Details of the user that created the service account. (see [below for nested schema](#nestedatt--created_by)) +- `description` (String) Description of the service account. +- `name` (String) Name of the service account. +- `status` (String) The status of the service account. + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) +- `full_name` (String) +- `username` (String) diff --git a/docs/data-sources/tag.md b/docs/data-sources/tag.md new file mode 100644 index 00000000..d63cb94a --- /dev/null +++ b/docs/data-sources/tag.md @@ -0,0 +1,34 @@ +--- +title: "scalr_tag" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_tag" +parentDocSlug: "provider_datasources" +hidden: false +order: 16 +--- +## Data Source Overview + +Retrieves information about a tag. + +## Example Usage + +```terraform +data "scalr_tag" "example1" { + id = "tag-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_tag" "example2" { + name = "tag-name" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) The ID of the Scalr account, in the format `acc-`. +- `id` (String) The identifier of the tag in the format `tag-`. +- `name` (String) The name of the tag. diff --git a/docs/data-sources/variable.md b/docs/data-sources/variable.md new file mode 100644 index 00000000..298f5ce4 --- /dev/null +++ b/docs/data-sources/variable.md @@ -0,0 +1,48 @@ +--- +title: "scalr_variable" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_variable" +parentDocSlug: "provider_datasources" +hidden: false +order: 17 +--- +## Data Source Overview + +Retrieves the details of a variable. + +## Example Usage + +```terraform +data "scalr_variable" "example1" { + id = "var-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_variable" "example2" { + key = "key" + category = "terraform" + account_id = "acc-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" + workspace_id = "ws-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-` +- `category` (String) The category of a Scalr variable. +- `environment_id` (String) The identifier of the Scalr environment, in the format `env-`. Used to shrink the scope of the variable in case the variable name exists in multiple environments. +- `id` (String) ID of a Scalr variable. +- `key` (String) The name of a Scalr variable. +- `workspace_id` (String) The identifier of the Scalr workspace, in the format `ws-`. Used to shrink the scope of the variable in case the variable name exists on multiple workspaces. + +### Read-Only + +- `description` (String) Variable verbose description, defaults to empty string. +- `final` (Boolean) If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. +- `hcl` (Boolean) If the variable is configured as a string of HCL code. +- `sensitive` (Boolean) If the variable is configured as sensitive. +- `value` (String) Variable value. diff --git a/docs/data-sources/variables.md b/docs/data-sources/variables.md new file mode 100644 index 00000000..bef6df76 --- /dev/null +++ b/docs/data-sources/variables.md @@ -0,0 +1,56 @@ +--- +title: "scalr_variables" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_variables" +parentDocSlug: "provider_datasources" +hidden: false +order: 18 +--- +## Data Source Overview + +Retrieves the list of variables by the given filters. + +## Example Usage + +```terraform +data "scalr_variables" "example" { + keys = ["key1", "key2", "key3"] + category = "terraform" # or shell + account_id = "acc-xxxxxxxxxx" + envrironment_ids = ["env-xxxxxxxxxx", "null"] + workspace_ids = ["ws-xxxxxxxxxx", "null"] +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `category` (String) The category of a Scalr variable. +- `environment_ids` (Set of String) A list of identifiers of the Scalr environments, in the format `env-`. Used to shrink the variable's scope in case the variable name exists in multiple environments. +- `keys` (Set of String) A list of keys to be used in the query used in a Scalr variable name filter. +- `workspace_ids` (Set of String) A list of identifiers of the Scalr workspace, in the format `ws-`. Used to shrink the variable's scope in case the variable name exists on multiple workspaces. + +### Read-Only + +- `id` (String) The ID of this resource. +- `variables` (Set of Object) The list of Scalr variables with all attributes. (see [below for nested schema](#nestedatt--variables)) + + +### Nested Schema for `variables` + +Read-Only: + +- `account_id` (String) The account that owns the variable, specified as an ID, in the format `acc-`. +- `category` (String) Indicates if this is a Terraform or shell variable. +- `description` (String) Variable verbose description. +- `environment_id` (String) The environment that owns the variable, specified as an ID, in the format `env-`. +- `final` (Boolean) If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. +- `hcl` (Boolean) If the variable is configured as a string of HCL code. +- `id` (String) ID of the variable. +- `key` (String) Key of the variable. +- `sensitive` (Boolean) If the variable is configured as sensitive. +- `value` (String) Variable value if it is not sensitive. +- `workspace_id` (String) The workspace that owns the variable, specified as an ID, in the format `ws-`. diff --git a/docs/data-sources/vcs_provider.md b/docs/data-sources/vcs_provider.md new file mode 100644 index 00000000..a176ce91 --- /dev/null +++ b/docs/data-sources/vcs_provider.md @@ -0,0 +1,42 @@ +--- +title: "scalr_vcs_provider" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_vcs_provider" +parentDocSlug: "provider_datasources" +hidden: false +order: 19 +--- +## Data Source Overview + +Retrieves the details of a VCS provider. + +## Example Usage + +```terraform +data "scalr_vcs_provider" "example1" { + id = "vcs-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_vcs_provider" "example2" { + name = "example" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `agent_pool_id` (String) The id of the agent pool to connect Scalr to self-hosted VCS provider, in the format `apool-`. +- `environment_id` (String) ID of the environment the VCS provider has to be linked to, in the format `env-`. +- `id` (String) Identifier of the VCS provider. +- `name` (String) Name of the VCS provider. +- `vcs_type` (String) Type of the VCS provider. For example, `github`. + +### Read-Only + +- `environments` (List of String) List of the identifiers of environments the VCS provider is linked to. +- `url` (String) The URL to the VCS provider installation. diff --git a/docs/data-sources/webhook.md b/docs/data-sources/webhook.md new file mode 100644 index 00000000..0d923a88 --- /dev/null +++ b/docs/data-sources/webhook.md @@ -0,0 +1,57 @@ +--- +title: "scalr_webhook" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_webhook" +parentDocSlug: "provider_datasources" +hidden: false +order: 20 +--- +## Data Source Overview + +Retrieves the details of a webhook. + +## Example Usage + +```terraform +data "scalr_webhook" "example1" { + id = "wh-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_webhook" "example2" { + name = "webhook_name" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `id` (String) The webhook ID, in the format `wh-`. +- `name` (String) Name of the webhook. + +### Read-Only + +- `enabled` (Boolean) Boolean indicates if the webhook is enabled. +- `endpoint_id` (String, Deprecated) ID of the endpoint, in the format `ep-`. +- `environment_id` (String, Deprecated) ID of the environment, in the format `env-`. +- `environments` (Set of String) The list of environment identifiers that the webhook is shared to, or `["*"]` if shared with all environments. +- `events` (List of String) List of event IDs. +- `header` (Set of Object) Additional headers to set in the webhook request. (see [below for nested schema](#nestedatt--header)) +- `last_triggered_at` (String) Date/time when webhook was last triggered. +- `max_attempts` (Number) Max delivery attempts of the payload. +- `secret_key` (String, Sensitive) Secret key to sign the webhook payload. +- `timeout` (Number) Endpoint timeout (in seconds). +- `url` (String) Endpoint URL. +- `workspace_id` (String, Deprecated) ID of the workspace, in the format `ws-`. + + +### Nested Schema for `header` + +Read-Only: + +- `name` (String) +- `value` (String) diff --git a/docs/data-sources/workspace.md b/docs/data-sources/workspace.md new file mode 100644 index 00000000..09442a58 --- /dev/null +++ b/docs/data-sources/workspace.md @@ -0,0 +1,94 @@ +--- +title: "scalr_workspace" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_workspace" +parentDocSlug: "provider_datasources" +hidden: false +order: 21 +--- +## Data Source Overview + +Retrieves the details of a single workspace. + +## Example Usage + +```terraform +data "scalr_workspace" "example1" { + id = "ws-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspace" "example2" { + name = "my-workspace-name" + environment_id = "env-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. + +### Optional + +- `id` (String) ID of the workspace. +- `name` (String) Name of the workspace. + +### Read-Only + +- `agent_pool_id` (String) The identifier of an agent pool in the format `apool-`. +- `auto_apply` (Boolean) Boolean indicates if `terraform apply` will be automatically run when `terraform plan` ends without error. +- `auto_queue_runs` (String) Indicates if runs have to be queued automatically when a new configuration version is uploaded. + + Supported values are `skip_first`, `always`, `never`: + + * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior. + * `always` - runs will be triggered automatically on every upload of the configuration version. + * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered. +- `created_by` (List of Object) Details of the user that created the workspace. (see [below for nested schema](#nestedatt--created_by)) +- `deletion_protection_enabled` (Boolean) Boolean, indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed. +- `execution_mode` (String) Execution mode of the workspace. +- `force_latest_run` (Boolean) Boolean indicates if latest new run will be automatically raised in priority. +- `has_resources` (Boolean) The presence of active terraform resources in the current state version. +- `hooks` (List of Object) List of custom hooks in a workspace. (see [below for nested schema](#nestedatt--hooks)) +- `module_version_id` (String) The identifier of a module version in the format `modver-`. +- `operations` (Boolean) Boolean indicates if the workspace is being used for remote execution. +- `tag_ids` (List of String) List of tag IDs associated with the workspace. +- `terraform_version` (String) The version of Terraform used for this workspace. +- `vcs_provider_id` (String) The identifier of a VCS provider in the format `vcs-`. +- `vcs_repo` (List of Object) If a workspace is linked to a VCS repository this block shows the details, otherwise `{}` (see [below for nested schema](#nestedatt--vcs_repo)) +- `working_directory` (String) A relative path that Terraform will execute within. + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) Email address of creator. +- `full_name` (String) Full name of creator. +- `username` (String) Username of creator. + + + +### Nested Schema for `hooks` + +Read-Only: + +- `post_apply` (String) Script or action configured to call after apply phase. +- `post_plan` (String) Script or action configured to call after plan phase. +- `pre_apply` (String) Script or action configured to call before apply phase. +- `pre_init` (String) Script or action configured to call before init phase. +- `pre_plan` (String) Script or action configured to call before plan phase. + + + +### Nested Schema for `vcs_repo` + +Read-Only: + +- `dry_runs_enabled` (Boolean) Boolean indicates the VCS-driven dry runs should run when the pull request to the configuration versions branch is created. +- `identifier` (String) The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider. +- `ingress_submodules` (Boolean) Designates whether to clone git submodules of the VCS repository. +- `path` (String) Path within the repo, if any. diff --git a/docs/data-sources/workspace_ids.md b/docs/data-sources/workspace_ids.md new file mode 100644 index 00000000..4c09e38a --- /dev/null +++ b/docs/data-sources/workspace_ids.md @@ -0,0 +1,38 @@ +--- +title: "scalr_workspace_ids" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_workspace_ids" +parentDocSlug: "provider_datasources" +hidden: false +order: 22 +--- +## Data Source Overview + +Retrieves a map of workspace IDs based on the names provided. Wildcards are accepted. + +## Example Usage + +```terraform +data "scalr_workspace_ids" "app-frontend" { + names = ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"] + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspace_ids" "all" { + names = ["*"] + environment_id = "env-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. +- `names` (List of String) A list of names to search for. If a name does not exist, it will not throw an error, it will just not exist in the returned output. Use `["*"]` to select all workspaces. + +### Read-Only + +- `id` (String) The ID of this resource. +- `ids` (Map of String) A map of workspace names and their opaque IDs, in the format `env_id/name`. diff --git a/docs/data-sources/workspaces.md b/docs/data-sources/workspaces.md new file mode 100644 index 00000000..5768b023 --- /dev/null +++ b/docs/data-sources/workspaces.md @@ -0,0 +1,47 @@ +--- +title: "scalr_workspaces" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_scalr_workspaces" +parentDocSlug: "provider_datasources" +hidden: false +order: 23 +--- +## Data Source Overview + +Retrieves a list of workspace ids by name or tags. + +## Example Usage + +```terraform +data "scalr_workspaces" "exact-names" { + name = "in:production,development" +} + +data "scalr_workspaces" "app-frontend" { + name = "like:app-frontend-" + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspaces" "tagged" { + tag_ids = ["tag-xxxxxxxxxx", "tag-xxxxxxxxxx"] +} + +data "scalr_workspaces" "all" { + environment_id = "env-xxxxxxxxxx" +} +``` + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `environment_id` (String) ID of the environment, in the format `env-`. +- `name` (String) The query used in a Scalr workspace name filter. +- `tag_ids` (Set of String) List of tag IDs associated with the workspace. + +### Read-Only + +- `id` (String) The ID of this resource. +- `ids` (List of String) The list of workspace IDs, in the format [`ws-xxxxxxxxxxx`, `ws-yyyyyyyyy`]. diff --git a/docs/index.md b/docs/index.md index 0e2ecdcc..8c22c399 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,40 +1,71 @@ --- -layout: "scalr" -page_title: "Provider: Scalr" -sidebar_current: "docs-scalr-index" -description: |- - The Scalr provider is used to interact with the many resources supported by Scalr. The provider needs to be configured with the proper credentials before it can be used. +title: "Overview" +categorySlug: "scalr-terraform-provider" +slug: "provider_overview" +order: 0 +hidden: false --- +The Scalr Terraform provider can be used to manage objects in Scalr with Terraform. -# Scalr Provider +Using the Scalr Terraform provider is a best practice as you scale your Terraform and Scalr operations. It is not required, but many customers have a Scalr admin environment and workspace(s), which use the provider to manage all other objects in Scalr. -## Example Usage +Some customers have built a Scalr "vending" machine, which continues the automation already done with cloud vending machines. The goal is to vend out Scalr environments and/or workspaces as teams are onboarded with objects preconfigured to allow for a seamless onboarding experience. -```hcl -# Configure the Scalr Provider +## Usage + +To use the Scalr provider, add the following code block to your code: + +```terraform +terraform { + required_providers { + scalr = { + source = "registry.scalr.io/scalr/scalr" + version = "~> 1.0" + } + } +} +``` + +The latest information on the provider version can be found at https://registry.scalr.io. +The GPG key information for the provider can be found at https://registry.scalr.io/scalr_pubkey.asc. +The fingerprint for the provider is `1EF68C8041FC80714FF7A4017F685A20F41004C4`. + +## Authentication + +To authenticate to the provider, you must obtain a Scalr API token and call the provider with it: + +```terraform provider "scalr" { hostname = var.hostname - token = var.token + token = var.api_token } +``` -# Create a workspace -resource "scalr_workspace" "example" { - name = "my-workspace-name" - environment_id = "env-xxxxxxxxx" - vcs_provider_id = "my_vcs_provider" - vcs_repo { - identifier = "org/repo" - branch = "dev" - } -} +If authentication is being done with shell variables, the following variables can be used: + +```shell +export SCALR_HOSTNAME=".scalr.io" +export SCALR_TOKEN="xxxxxxxxxxxxxxxxxx" ``` -## Argument Reference +If you have tokens stored in files locally, the `~/.terraform.d/credentials.tfrc.json` file will take precedence over those in `~/.terraformrc`. + +## Service Account Authentication + +As mentioned, a best practice is to use the Scalr Terraform provider to manage objects within Scalr. + +If you are using Scalr to execute the Terraform runs that call the Scalr provider, you must override a default token set for each run. The default token has minimal permissions to allow for the run execution, which means the run will fail if you don't set the `SCALR_TOKEN` variable in the workspace. It is recommended to use a [service account](/docs/identity-and-access-management#service-accounts) for the token. + +![SCALR_TOKEN Variable](https://files.readme.io/2a1d8e3-Screen_Shot_2022-11-28_at_12.19.04_PM.png) + +## Example - Scalr Ignite + +Not sure where to get started? Take a look at the Ignite repo, which will deploy a sample organizational structure in Scalr through the Terraform provider. This is meant to give you a starting point which you can build upon and is also a great example of how you can use YAML with the provider if needed: https://github.com/sierra-cedar/scalr-ignite. + + +## Schema -The following arguments are supported for the provider: +### Optional -* `hostname` - (Optional) The Scalr hostname to connect to. - Defaults to `my.scalr.com`. Can be overridden by setting the - `SCALR_HOSTNAME` environment variable. -* `token` - (Optional) The token used to authenticate with Scalr. - Can be overridden by setting the `SCALR_TOKEN` environment variable. See [Scalr Terraform Provider](https://docs.scalr.com/en/latest/scalr-terraform-provider/index.html) for information on generating a token. +- `hostname` (String) The Scalr hostname to connect to. Defaults to `scalr.io`. Can be overridden by setting the `SCALR_HOSTNAME` environment variable. +- `token` (String) The token used to authenticate with Scalr. Can be overridden by setting the `SCALR_TOKEN` environment variable. See [Scalr provider configuration](/docs/scalr) for information on generating a token. diff --git a/docs/resources/access_policy.md b/docs/resources/access_policy.md new file mode 100644 index 00000000..be4fa539 --- /dev/null +++ b/docs/resources/access_policy.md @@ -0,0 +1,79 @@ +--- +title: "scalr_access_policy" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_access_policy" +parentDocSlug: "provider_resources" +hidden: false +order: 1 +--- +## Resource Overview + +Manages the Scalr IAM access policies. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_role" "reader" { + name = "Reader" + account_id = "acc-xxxxxxxxxx" + description = "Read access to all resources." + + permissions = [ + "*:read", + ] +} + +resource "scalr_access_policy" "team_read_all_on_acc_scope" { + subject { + type = "team" + id = "team-xxxxxxxxxx" + } + scope { + type = "account" + id = "acc-xxxxxxxxxx" + } + + role_ids = [ + scalr_role.reader.id + ] +} +``` + + +## Schema + +### Required + +- `role_ids` (List of String) The list of the role IDs. +- `scope` (Block List, Min: 1, Max: 1) Defines the scope where access policy is applied. (see [below for nested schema](#nestedblock--scope)) +- `subject` (Block List, Min: 1, Max: 1) Defines the subject of the access policy. (see [below for nested schema](#nestedblock--subject)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `is_system` (Boolean) The access policy is a built-in read-only policy that cannot be updated or deleted. + + +### Nested Schema for `scope` + +Required: + +- `id` (String) The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace. +- `type` (String) The scope identity type, is one of `account`, `environment`, or `workspace`. + + + +### Nested Schema for `subject` + +Required: + +- `id` (String) The subject ID, `user-` for user, `team-` for team, `sa-` for service account. +- `type` (String) The subject type, is one of `user`, `team`, or `service_account`. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_access_policy.example ap-xxxxxxxxxx +``` diff --git a/docs/resources/account_allowed_ips.md b/docs/resources/account_allowed_ips.md new file mode 100644 index 00000000..fed16005 --- /dev/null +++ b/docs/resources/account_allowed_ips.md @@ -0,0 +1,45 @@ +--- +title: "scalr_account_allowed_ips" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_account_allowed_ips" +parentDocSlug: "provider_resources" +hidden: false +order: 2 +--- +## Resource Overview + +Manages the list of allowed IPs for an account in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_account_allowed_ips" "default" { + account_id = "acc-xxxxxxxxxx" + allowed_ips = ["127.0.0.1", "192.168.0.0/24"] +} +``` + + +## Schema + +### Required + +- `allowed_ips` (List of String) The list of allowed IPs or CIDRs. + + **Warning**: if you don't specify the current IP address, you may lose access to the account. To restore it the account owner has to raise a [support ticket](https://support.scalr.com). + +### Optional + +- `account_id` (String) ID of the account. + +### Read-Only + +- `id` (String) The ID of this resource. Equals to the ID of the account. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_account_allowed_ips.example acc-xxxxxxxxxx +``` diff --git a/docs/resources/agent_pool.md b/docs/resources/agent_pool.md new file mode 100644 index 00000000..9c543c01 --- /dev/null +++ b/docs/resources/agent_pool.md @@ -0,0 +1,45 @@ +--- +title: "scalr_agent_pool" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_agent_pool" +parentDocSlug: "provider_resources" +hidden: false +order: 3 +--- +## Resource Overview + +Manage the state of agent pools in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_agent_pool" "default" { + name = "default-pool" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the agent pool. + +### Optional + +- `account_id` (String) ID of the account. +- `environment_id` (String) ID of the environment. +- `vcs_enabled` (Boolean) Indicates whether the VCS support is enabled for agents in the pool. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_agent_pool.example apool-xxxxxxxxxx +``` diff --git a/docs/resources/agent_pool_token.md b/docs/resources/agent_pool_token.md new file mode 100644 index 00000000..d12ed0f7 --- /dev/null +++ b/docs/resources/agent_pool_token.md @@ -0,0 +1,33 @@ +--- +title: "scalr_agent_pool_token" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_agent_pool_token" +parentDocSlug: "provider_resources" +hidden: false +order: 4 +--- +## Resource Overview + +Manage the state of agent pool's tokens in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_agent_pool_token" "default" { + description = "Some description" + agent_pool_id = "apool-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `agent_pool_id` (String) ID of the agent pool. +- `description` (String) Description of the token. + +### Read-Only + +- `id` (String) The ID of this resource. +- `token` (String, Sensitive) The token of the agent pool. diff --git a/docs/resources/endpoint.md b/docs/resources/endpoint.md new file mode 100644 index 00000000..a198d455 --- /dev/null +++ b/docs/resources/endpoint.md @@ -0,0 +1,69 @@ +--- +title: "scalr_endpoint" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_endpoint" +parentDocSlug: "provider_resources" +hidden: false +order: 5 +--- +## Resource Overview + +Manage the state of endpoints in Scalr. Create, update and destroy. + +> 🚧 This resource is deprecated and will be removed in the next major version. + +## Example Usage + +```terraform +resource "scalr_endpoint" "example" { + name = "my-endpoint-name" + secret_key = "my-secret-key" + timeout = 15 + max_attempts = 3 + url = "https://my-endpoint.url" + environment_id = "env-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. +- `name` (String) Name of the endpoint. +- `url` (String) Endpoint URL. + +### Optional + +- `max_attempts` (Number) Max delivery attempts. +- `secret_key` (String, Sensitive) Secret key to sign payload. +- `timeout` (Number) Endpoint timeout (in sec). + +### Read-Only + +- `id` (String) The ID of this resource. + +## Useful snippets + +The secret key can be generated using the `random_string` resource. + +```terraform +resource "random_string" "r" { + length = 16 +} + +resource "scalr_endpoint" "example" { + # ... + secret_key = random_string.r.result + # ... +} +``` + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_endpoint.example ep-xxxxxxxxxx +``` diff --git a/docs/resources/environment.md b/docs/resources/environment.md new file mode 100644 index 00000000..8bac2196 --- /dev/null +++ b/docs/resources/environment.md @@ -0,0 +1,61 @@ +--- +title: "scalr_environment" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_environment" +parentDocSlug: "provider_resources" +hidden: false +order: 6 +--- +## Resource Overview + +Manage the state of environments in Scalr. Creates, updates and destroys. + +## Example Usage + +```terraform +resource "scalr_environment" "test" { + name = "test-env" + account_id = "acc-xxxxxxxxxx" + cost_estimation_enabled = true + policy_groups = ["pgrp-xxxxxxxxxx", "pgrp-yyyyyyyyyy"] + default_provider_configurations = ["pcfg-xxxxxxxxxx", "pcfg-yyyyyyyyyy"] +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the environment. + +### Optional + +- `account_id` (String) ID of the environment account, in the format `acc-`. +- `cost_estimation_enabled` (Boolean) Set (true/false) to enable/disable cost estimation for the environment. Default `true`. +- `default_provider_configurations` (Set of String) List of IDs of provider configurations, used in the environment workspaces by default. +- `policy_groups` (List of String) List of the environment policy-groups IDs, in the format `pgrp-`. +- `tag_ids` (Set of String) List of tag IDs associated with the environment. + +### Read-Only + +- `created_by` (List of Object) Details of the user that created the environment. (see [below for nested schema](#nestedatt--created_by)) +- `id` (String) The ID of this resource. +- `status` (String) The status of the environment. + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) +- `full_name` (String) +- `username` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_environment.example env-xxxxxxxxxx +``` diff --git a/docs/resources/iam_team.md b/docs/resources/iam_team.md new file mode 100644 index 00000000..d012367a --- /dev/null +++ b/docs/resources/iam_team.md @@ -0,0 +1,49 @@ +--- +title: "scalr_iam_team" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_iam_team" +parentDocSlug: "provider_resources" +hidden: false +order: 7 +--- +## Resource Overview + +Manages the Scalr IAM teams: performs create, update and destroy actions. + +## Example Usage + +```terraform +resource "scalr_iam_team" "example" { + name = "dev" + description = "Developers" + account_id = "acc-xxxxxxxxxx" + + users = ["user-xxxxxxxxxx", "user-yyyyyyyyyy"] +} +``` + + +## Schema + +### Required + +- `name` (String) A name of the team. + +### Optional + +- `account_id` (String) An identifier of the Scalr account, in the format `acc-`. +- `description` (String) A verbose description of the team. +- `identity_provider_id` (String) An identifier of the login identity provider, in the format `idp-`. This is required when `account_id` is not specified. +- `users` (List of String) A list of the user identifiers to add to the team. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_iam_team.example team-xxxxxxxxxx +``` diff --git a/docs/resources/module.md b/docs/resources/module.md new file mode 100644 index 00000000..95e1156a --- /dev/null +++ b/docs/resources/module.md @@ -0,0 +1,67 @@ +--- +title: "scalr_module" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_module" +parentDocSlug: "provider_resources" +hidden: false +order: 8 +--- +## Resource Overview + +Manages the state of a module in the Private Modules Registry. Create and destroy operations are available only. + +## Example Usage + +```terraform +resource "scalr_module" "example" { + account_id = "acc-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" + vcs_provider_id = "vcs-xxxxxxxxxx" + vcs_repo { + identifier = "org/repo" + path = "example/terraform--" + tag_prefix = "aws/" + } +} +``` + + +## Schema + +### Required + +- `vcs_provider_id` (String) The identifier of a VCS provider in the format `vcs-`. +- `vcs_repo` (Block List, Min: 1, Max: 1) Source configuration of a VCS repository. (see [below for nested schema](#nestedblock--vcs_repo)) + +### Optional + +- `account_id` (String) The identifier of the account in the format `acc-`. If it is not specified the module will be registered globally and available across the whole installation. +- `environment_id` (String) The identifier of an environment in the format `env-`. If it is not specified the module will be registered at the account level and available across all environments within the account specified in `account_id` attribute. + +### Read-Only + +- `id` (String) The ID of this resource. +- `module_provider` (String) Module provider name, e.g `aws`, `azurerm`, `google`, etc. +- `name` (String) Name of the module, e.g. `rds`, `compute`, `kubernetes-engine`. +- `source` (String) The source of a remote module in the private registry, e.g `env-xxxx/aws/vpc`. +- `status` (String) A system status of the Module. + + +### Nested Schema for `vcs_repo` + +Required: + +- `identifier` (String) The identifier of a VCS repository in the format `:org/:repo` (`:org/:project/:name` is used for Azure DevOps). It refers to an organization and a repository name in a VCS provider. + +Optional: + +- `path` (String) The path to the root module folder. It is expected to have the format `/terraform--`, where `` stands for any folder within the repository inclusively a repository root. +- `tag_prefix` (String) Registry ignores tags which do not match specified prefix, e.g. `aws/`. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_module.example mod-xxxxxxxxxx +``` diff --git a/docs/resources/policy_group.md b/docs/resources/policy_group.md new file mode 100644 index 00000000..e1250253 --- /dev/null +++ b/docs/resources/policy_group.md @@ -0,0 +1,79 @@ +--- +title: "scalr_policy_group" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_policy_group" +parentDocSlug: "provider_resources" +hidden: false +order: 9 +--- +## Resource Overview + +Manage the state of policy groups in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_policy_group" "example" { + name = "instance_types" + opa_version = "0.29.4" + account_id = "acc-xxxxxxxxxx" + vcs_provider_id = "vcs-xxxxxxxxxx" + vcs_repo { + identifier = "org/repo" + path = "policies/instance" + branch = "dev" + } +} +``` + + +## Schema + +### Required + +- `name` (String) The name of a policy group. +- `vcs_provider_id` (String) The identifier of a VCS provider, in the format `vcs-`. +- `vcs_repo` (Block List, Min: 1, Max: 1) The VCS meta-data to create the policy from. (see [below for nested schema](#nestedblock--vcs_repo)) + +### Optional + +- `account_id` (String) The identifier of the Scalr account, in the format `acc-`. +- `opa_version` (String) The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned. + +### Read-Only + +- `environments` (List of String) A list of the environments the policy group is linked to. +- `error_message` (String) A detailed error if Scalr failed to process the policy group. +- `id` (String) The ID of this resource. +- `policies` (List of Object) A list of the OPA policies the group verifies each run. (see [below for nested schema](#nestedatt--policies)) +- `status` (String) A system status of the Policy group. + + +### Nested Schema for `vcs_repo` + +Required: + +- `identifier` (String) The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider. + +Optional: + +- `branch` (String) The branch of a repository the policy group is associated with. If omitted, the repository default branch will be used. +- `path` (String) The subdirectory of the VCS repository where OPA policies are stored. If omitted or submitted as an empty string, this defaults to the repository's root. + + + +### Nested Schema for `policies` + +Read-Only: + +- `enabled` (Boolean) +- `enforced_level` (String) +- `name` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_policy_group.example pgrp-xxxxxxxxxx +``` diff --git a/docs/resources/policy_group_linkage.md b/docs/resources/policy_group_linkage.md new file mode 100644 index 00000000..1f642cb0 --- /dev/null +++ b/docs/resources/policy_group_linkage.md @@ -0,0 +1,40 @@ +--- +title: "scalr_policy_group_linkage" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_policy_group_linkage" +parentDocSlug: "provider_resources" +hidden: false +order: 10 +--- +## Resource Overview + +Manage policy group to environment linking in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_policy_group_linkage" "example" { + policy_group_id = "pgrp-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. +- `policy_group_id` (String) ID of the policy group, in the format `pgrp-`. + +### Read-Only + +- `id` (String) The ID of the policy group linkage. It is a combination of the policy group and environment IDs in the format `pgrp-xxxxxxxxxxxxxxx/env-yyyyyyyyyyyyyyy` + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_policy_group_linkage.example pgrp-xxxxxxxxxx/env-xxxxxxxxxx +``` diff --git a/docs/resources/provider_configuration.md b/docs/resources/provider_configuration.md new file mode 100644 index 00000000..e35784a2 --- /dev/null +++ b/docs/resources/provider_configuration.md @@ -0,0 +1,248 @@ +--- +title: "scalr_provider_configuration" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_provider_configuration" +parentDocSlug: "provider_resources" +hidden: false +order: 11 +--- +## Resource Overview + +A provider configuration helps organizations manage provider secrets in a centralized way. It natively supports the management of the major providers like Scalr, AWS, AzureRM, and Google Cloud Platform, but also allows registering any custom provider. Please have a look at the basic usage examples for each provider type. + +## Example Usage + +### Scalr provider + +```terraform +resource "scalr_provider_configuration" "scalr" { + name = "scalr" + account_id = "acc-xxxxxxxxxx" + environments = ["*"] + scalr { + hostname = "scalr.host.example.com" + token = "my-scalr-token" + } +} +``` + +### AWS provider + +```terraform +resource "scalr_provider_configuration" "aws" { + name = "aws_dev_us_east_1" + account_id = "acc-xxxxxxxxxx" + export_shell_variables = false + environments = ["env-xxxxxxxxxx"] + aws { + account_type = "regular" + credentials_type = "access_keys" + secret_key = "my-secret-key" + access_key = "my-access-key" + } +} +``` + +```terraform +resource "scalr_provider_configuration" "oidc" { + name = "oidc_dev_us_east_1" + account_id = "acc-xxxxxxxxxx" + export_shell_variables = false + environments = ["*"] + aws { + credentials_type = "oidc" + role_arn = "arn:aws:iam::123456789012:role/scalr-oidc-role" + audience = "aws.scalr-run-workload" + } +} +``` + +To get into more advanced AWS usage please refer to the official [AWS module](https://github.com/Scalr/terraform-scalr-provider-configuration-aws). + +### AzureRM provider + +```terraform +resource "scalr_provider_configuration" "azurerm" { + name = "azurerm" + account_id = "acc-xxxxxxxxxx" + azurerm { + client_id = "my-client-id" + client_secret = "my-client-secret" + subscription_id = "my-subscription-id" + tenant_id = "my-tenant-id" + } +} +``` + +```terraform +resource "scalr_provider_configuration" "azurerm_oidc" { + name = "azurerm" + account_id = "acc-xxxxxxxxxx" + azurerm { + auth_type = "oidc" + audience = "scalr-workload-identity" + client_id = "my-client-id" + tenant_id = "my-tenant-id" + subscription_id = "my-subscription-id" + } +} +``` + +### Google provider + +```terraform +resource "scalr_provider_configuration" "google" { + name = "google_main" + account_id = "acc-xxxxxxxxxx" + google { + project = "my-project" + credentials = "my-credentials" + } +} +``` + +```terraform +resource "scalr_provider_configuration" "google" { + name = "google_main" + account_id = "acc-xxxxxxxxxx" + google { + auth_type = "oidc" + project = "my-project" + service_account_email = "user@example.com" + workload_provider_name = "projects/123/locations/global/workloadIdentityPools/pool-name/providers/provider-name" + } +} +``` + +### Custom providers + +```terraform +resource "scalr_provider_configuration" "kubernetes" { + name = "k8s" + account_id = "acc-xxxxxxxxxx" + custom { + provider_name = "kubernetes" + argument { + name = "host" + value = "my-host" + description = "The hostname (in form of URI) of the Kubernetes API." + } + argument { + name = "username" + value = "my-username" + } + argument { + name = "password" + value = "my-password" + sensitive = true + } + } +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Scalr provider configuration. This field is unique for the account. + +### Optional + +- `account_id` (String) The account that owns the object, specified as an ID. +- `aws` (Block List, Max: 1) Settings for the aws provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. (see [below for nested schema](#nestedblock--aws)) +- `azurerm` (Block List, Max: 1) Settings for the azurerm provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. (see [below for nested schema](#nestedblock--azurerm)) +- `custom` (Block List, Max: 1) Settings for the provider configuration that does not have scalr support as a built-in provider. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. (see [below for nested schema](#nestedblock--custom)) +- `environments` (Set of String) The list of environment identifiers that the provider configuration is shared to. Use `["*"]` to share with all environments. +- `export_shell_variables` (Boolean) Export provider variables into the run environment. This option is available for built-in (Scalr, AWS, AzureRM, Google) providers only. +- `google` (Block List, Max: 1) Settings for the google provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. (see [below for nested schema](#nestedblock--google)) +- `scalr` (Block List, Max: 1) Settings for the Scalr provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. (see [below for nested schema](#nestedblock--scalr)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `aws` + +Required: + +- `credentials_type` (String) The type of AWS credentials, available options: `access_keys`, `role_delegation`, `oidc`. + +Optional: + +- `access_key` (String) AWS access key. This option is required with `access_keys` credentials type. +- `account_type` (String) The type of AWS account, available options: `regular`, `gov-cloud`, `cn-cloud`. +- `audience` (String) The value of the `aud` claim for the identity token. This option is required with `oidc` credentials type. +- `external_id` (String) External identifier to use when assuming the role. This option is required with `role_delegation` credentials type and `aws_account` trusted entity type. +- `role_arn` (String) Amazon Resource Name (ARN) of the IAM Role to assume. This option is required with the `role_delegation` and `oidc` credentials type. +- `secret_key` (String, Sensitive) AWS secret key. This option is required with `access_keys` credentials type. +- `trusted_entity_type` (String) Trusted entity type, available options: `aws_account`, `aws_service`. This option is required with `role_delegation` credentials type. + + + +### Nested Schema for `azurerm` + +Required: + +- `client_id` (String) The Client ID that should be used. +- `tenant_id` (String) The Tenant ID that should be used. + +Optional: + +- `audience` (String) The value of the `aud` claim for the identity token. This option is required with `oidc` authentication type. +- `auth_type` (String) Authentication type, either `client-secrets` (default) or `oidc`. +- `client_secret` (String) The Client Secret that should be used, required when `auth_type` is `client-secrets`. +- `subscription_id` (String) The Subscription ID that should be used. If skipped, it must be set as a shell variable in the workspace or as a part of the source configuration. + + + +### Nested Schema for `custom` + +Required: + +- `argument` (Block Set, Min: 1) The provider configuration argument. Multiple instances are allowed per block. (see [below for nested schema](#nestedblock--custom--argument)) +- `provider_name` (String) The name of a Terraform provider. + + +### Nested Schema for `custom.argument` + +Required: + +- `name` (String) The name of the provider configuration argument. + +Optional: + +- `description` (String) The description of the provider configuration argument. +- `sensitive` (Boolean) Set (true/false) to configure as sensitive. Default `false`. +- `value` (String) The value of the provider configuration argument. + + + + +### Nested Schema for `google` + +Optional: + +- `auth_type` (String) Authentication type, either `service-account-key` (default) or `oidc`. +- `credentials` (String, Sensitive) Service account key file in JSON format, required when `auth_type` is `service-account-key`. +- `project` (String) The default project to manage resources in. If another project is specified on a resource, it will take precedence. +- `service_account_email` (String) The service account email used to authenticate to GCP, required when `auth_type` is `oidc`. +- `workload_provider_name` (String) The canonical name of the workload identity provider, required when `auth_type` is `oidc`. + + + +### Nested Schema for `scalr` + +Required: + +- `hostname` (String) The Scalr hostname which should be used. +- `token` (String, Sensitive) The Scalr token which should be used. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_provider_configuration.example pcfg-xxxxxxxxxx +``` diff --git a/docs/resources/provider_configuration_default.md b/docs/resources/provider_configuration_default.md new file mode 100644 index 00000000..61eaf3e2 --- /dev/null +++ b/docs/resources/provider_configuration_default.md @@ -0,0 +1,42 @@ +--- +title: "scalr_provider_configuration_default" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_provider_configuration_default" +parentDocSlug: "provider_resources" +hidden: false +order: 12 +--- +## Resource Overview + +Manage defaults of provider configurations for environments in Scalr. Create and destroy. + +**Note:** To make the provider configuration default, it must be shared with the specified environment. See the definition of the resource [`scalr_provider_configuration`](provider_configuration.md) and attribute `environments` to learn more. + +## Example Usage + +```terraform +resource "scalr_provider_configuration_default" "example" { + environment_id = "env-xxxxxxxxxx" + provider_configuration_id = "pcfg-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. +- `provider_configuration_id` (String) ID of the provider configuration, in the format `pcfg-`. + +### Read-Only + +- `id` (String) The ID of the provider configuration default. It is a combination of the environment and provider configuration IDs in the format `env-xxxxxxxx/pcfg-xxxxxxxx` + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_provider_configuration_default.example env-xxxxxxxxxx/pcfg-xxxxxxxxxx +``` diff --git a/docs/resources/role.md b/docs/resources/role.md new file mode 100644 index 00000000..b0964362 --- /dev/null +++ b/docs/resources/role.md @@ -0,0 +1,53 @@ +--- +title: "scalr_role" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_role" +parentDocSlug: "provider_resources" +hidden: false +order: 13 +--- +## Resource Overview + +Manage the Scalr IAM roles. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_role" "writer" { + name = "Writer" + account_id = "acc-xxxxxxxxxx" + description = "Write access to all resources." + + permissions = [ + "*:update", + "*:delete", + "*:create" + ] +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the role. +- `permissions` (List of String) Array of permission names. + +### Optional + +- `account_id` (String) ID of the account. +- `description` (String) Verbose description of the role. + +### Read-Only + +- `id` (String) The ID of this resource. +- `is_system` (Boolean) Boolean indicates if the role can be edited. System roles are maintained by Scalr and cannot be changed. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_role.example role-xxxxxxxxxx +``` diff --git a/docs/resources/run_trigger.md b/docs/resources/run_trigger.md new file mode 100644 index 00000000..cf79da11 --- /dev/null +++ b/docs/resources/run_trigger.md @@ -0,0 +1,51 @@ +--- +title: "scalr_run_trigger" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_run_trigger" +parentDocSlug: "provider_resources" +hidden: false +order: 14 +--- +## Resource Overview + +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 + +```terraform +data "scalr_workspace" "downstream" { + name = "downstream" + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspace" "upstream" { + name = "upstream" + environment_id = "env-xxxxxxxxxx" +} + +resource "scalr_run_trigger" "set_downstream" { + # run automatically triggered in this workspace once the run in the upstream workspace is applied + downstream_id = data.scalr_workspace.downstream.id + upstream_id = data.scalr_workspace.upstream.id +} +``` + + +## Schema + +### Required + +- `downstream_id` (String) The identifier of the workspace in which new runs will be triggered. +- `upstream_id` (String) The identifier of the upstream workspace. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_run_trigger.example rt-xxxxxxxxxx +``` diff --git a/docs/resources/scalr_access_policy.md b/docs/resources/scalr_access_policy.md deleted file mode 100644 index 2ef49eaf..00000000 --- a/docs/resources/scalr_access_policy.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Resource `scalr_access_policy` - -Manages the Scalr IAM access policies. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_role" "reader" { - name = "Reader" - account_id = "acc-xxxxxxxx" - description = "Read access to all resources." - - permissions = [ - "*:read", - ] -} - -resource "scalr_access_policy" "team_read_all_on_acc_scope" { - subject { - type = "team" - id = "team-xxxxxxx" - } - scope { - type = "account" - id = "acc-xxxxxxx" - } - - role_ids = [ - scalr_role.reader.id - ] -} -``` - -## Argument Reference - -* `scope` - (Required) Defines the scope where access policy is applied. -* `subject` - (Required) Defines the subject of the access policy. -* `role_ids` - (Required) The list of the role IDs. - - -## Attribute Reference - -All arguments plus: - -* `id` - The access policy ID. - -The `scope` block contains: - -* `type` - The scope identity type, is one of `account`, `environment`, or `workspace`. -* `id` - The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace. - -The `subject` block contains: - -* `type` - The subject type, is one of `user`, `team`, or `service_account`. -* `id` - The subject ID, `user-` for user, `team-` for team, `sa-` for service account.## Import - -To import an access policy use the access policy ID as the import ID. For example: - -```shell -terraform import scalr_access_policy.example ap-te2cteuismsqocd -``` diff --git a/docs/resources/scalr_account_allowed_ips.md b/docs/resources/scalr_account_allowed_ips.md deleted file mode 100644 index 6892c993..00000000 --- a/docs/resources/scalr_account_allowed_ips.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Resource `scalr_account_allowed_ips` - -Manages the list of allowed IPs for an account in Scalr. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_account_allowed_ips" "default" { - account_id = "acc-xxxxxxxx" - allowed_ips = ["127.0.0.1", "192.168.0.0/24"] -} -``` - -## Argument Reference - -* `account_id` - (Optional) ID of the account. -* `allowed_ips` - (Required) The list of allowed IPs or CIDRs. - **Warning**: if you don't specify the current IP address, you may lose access to the account. - To restore it the account owner has to raise a [support ticket](https://suport.scalr.com) - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the account. - -## Import - -To import allowed ips for an account use account ID as the import ID. For example: - -```shell -terraform import scalr_account_allowed_ips.default acc-xxxxxxxxx -``` diff --git a/docs/resources/scalr_agent_pool.md b/docs/resources/scalr_agent_pool.md deleted file mode 100644 index f9c74475..00000000 --- a/docs/resources/scalr_agent_pool.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Resource `scalr_agent_pool` - -Manage the state of agent pools in Scalr. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_agent_pool" "default" { - name = "default-pool" - account_id = "acc-xxxxxxxx" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the agent pool. -* `account_id` - (Optional) ID of the account. -* `environment_id` - (Optional) ID of the environment. -* `vcs_enabled` - (Optional) Indicates whether the VCS support is enabled for agents in the pool. - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the agent pool. - -## Import - -To import agent pool use agent pool ID as the import ID. For example: - -```shell -terraform import scalr_agent_pool.default apool-xxxxxxxxx -``` diff --git a/docs/resources/scalr_agent_pool_token.md b/docs/resources/scalr_agent_pool_token.md deleted file mode 100644 index 1ee1626e..00000000 --- a/docs/resources/scalr_agent_pool_token.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Resource `scalr_agent_pool_token` - -Manage the state of agent pool's tokens in Scalr. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_agent_pool_token" "default" { - description = "Some description" - agent_pool_id = "apool-xxxxxxx" -} -``` - -## Argument Reference - -* `description` - (Required) Description of the token. -* `agent_pool_id` - (Required) ID of the agent pool. - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the token. -* `token` - The token of the agent pool. diff --git a/docs/resources/scalr_endpoint.md b/docs/resources/scalr_endpoint.md deleted file mode 100644 index f2f2b675..00000000 --- a/docs/resources/scalr_endpoint.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Resource `scalr_endpoint` - -Manage the state of endpoints in Scalr. Create, update and destroy - -> **WARNING:** This resource is deprecated and will be removed in the next major version. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_endpoint" "example" { - name = "my-endpoint-name" - secret_key = "my-secret-key" - timeout = 15 - max_attempts = 3 - url = "https://my-endpoint.url" - environment_id = "env-xxxxxxxxxxxx" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the endpoint. -* `secret_key` - (Required) Secret key to sign payload. -* `environment_id` - (Required) ID of the environment, in the format `env-`. -* `url` - (Required) Endpoint URL. -* `max_attempts` - (Optional) Max delivery attempts. -* `timeout` - (Optional) Endpoint timeout (in sec). - -## Attribute Reference - -All arguments plus: - -* `id` - The endpoint's ID, in the format `ep-`. - -## Useful snippets - -The secret key can be generated using the `random_string` resource. - -```hcl -resource "random_string" "r" { - length = 16 -} - -resource "scalr_endpoint" "example" { - # ... - secret_key = random_string.r.result - # ... -} -``` diff --git a/docs/resources/scalr_environment.md b/docs/resources/scalr_environment.md deleted file mode 100644 index fe4fe3f7..00000000 --- a/docs/resources/scalr_environment.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Resource `scalr_environment` - -Manage the state of environments in Scalr. Creates, updates and destroys. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_environment" "test" { - name = "test-env" - account_id = "acc-" - cost_estimation_enabled = true - policy_groups = ["pgrp-xxxxx", "pgrp-yyyyy"] - default_provider_configurations = ["pcfg-xxxxx", "pcfg-yyyyy"] -} -``` - -## Argument Reference - -* `name` - (Required) Name of the environment. -* `account_id` - (Optional) ID of the environment account, in the format `acc-` -* `cost_estimation_enabled` - (Optional) Set (true/false) to enable/disable cost estimation for the environment. Default `true`. -* `policy_groups` - (Optional) List of the environment policy-groups IDs, in the format `pgrp-`. -* `default_provider_configurations` - (Optional) List of IDs of provider configurations, used in the environment workspaces by default. -* `tag_ids` - (Optional) List of tag IDs associated with the environment. - -## Attributes - -All arguments plus: - -* `id` - The environment ID, in the format `env-`. -* `created_by` - Details of the user that created the environment. -* `status` - The status of the environment. - -The `created_by` block contains: - -* `username` - Username of creator. -* `email` - Email address of creator. -* `full_name` - Full name of creator. diff --git a/docs/resources/scalr_iam_team.md b/docs/resources/scalr_iam_team.md deleted file mode 100644 index 1a27fd0b..00000000 --- a/docs/resources/scalr_iam_team.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Resource `scalr_iam_team` - -Manages the Scalr IAM teams: performs create, update and destroy actions. - -## Example Usage - -```hcl -resource "scalr_iam_team" "example" { - name = "dev" - description = "Developers" - account_id = "acc-xxxxxxxx" - - users = [ "user-xxxxxxxx", "user-yyyyyyyy" ] -} -``` - -## Argument Reference - -* `name` - (Required) A name of the team. -* `description` - (Optional) A verbose description of the team. -* `account_id` - (Optional) An identifier of the Scalr account, in the format `acc-`. -* `identity_provider_id` - (Optional) An identifier of the login identity provider, in the format `idp-`. This is required when `account_id` is not specified. -* `users` - (Optional) A list of the user identifiers to add to the team. - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the team. - -## Import - -To import teams use team ID as the import ID. For example: - -```shell -terraform import scalr_iam_team.example team-tntulnted6oom28 -``` diff --git a/docs/resources/scalr_module.md b/docs/resources/scalr_module.md deleted file mode 100644 index 23b2a044..00000000 --- a/docs/resources/scalr_module.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Resource `scalr_module` - -Manages the state of a module in the Private Modules Registry. Create and destroy operations are available only. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_module" "example" { - account_id = "acc-xxxxxxxxx" - environment_id = "env-xxxxxxxxx" - vcs_provider_id = "vcs-xxxxxxxxx" - vcs_repo { - identifier = "org/repo" - path = "example/terraform--" - tag_prefix = "aws/" - } -} - -``` - -## Argument Reference -* `vcs_provider_id` - (Required) The identifier of a VCS provider in the format `vcs-` -* `account_id` - (Optional) The identifier of the account in the format `acc-`. If it is not specified the module will be registered globally and available across the whole installation. -* `environment_id` - (Optional) The identifier of an environment in the format `env-`. If it is not specified the module will be registered at the account level and available across all environments within the account specified in `account_id` attribute. -* `vcs_repo` - (Required) Source configuration of a VCS repository - - The `vcs_repo` block supports: - - * `identifier` - (Required) The identifier of a VCS repository in the format `:org/:repo` (`:org/:project/:name` is used for Azure DevOps). It refers to an organization and a repository name in a VCS provider. - * `path` - (Optional) The path to the root module folder. It Is expected to have the format '/terraform--', where `` stands for any folder within the repository inclusively a repository root. - * `tag_prefix` - (Optional) Registry ignores tags which do not match specified prefix, e.g. `aws/`. - - -## Attribute Reference - -All arguments plus: - -* `id` - The identifier of a module in the format `mod--`. -* `module_provider` - Module provider name, e.g `aws`, `azurerm`, `google`, etc. -* `name` - Name of the module, e.g. `rds`, `compute`, `kubernetes-engine` - -* `source` - The source of a remote module in the private registry, e.g `env-xxxx/aws/vpc` - -## Import - -To import a module use the module ID as the import ID. For example: - -```shell -terraform import scalr_module.example mod-tk4315k3lofu4i0 -``` diff --git a/docs/resources/scalr_policy_group.md b/docs/resources/scalr_policy_group.md deleted file mode 100644 index 52f69907..00000000 --- a/docs/resources/scalr_policy_group.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Resource `scalr_policy_group` - -Manage the state of policy groups in Scalr. Create, update and destroy. - -## Example Usage - -```hcl -resource "scalr_policy_group" "example" { - name = "instance_types" - opa_version = "0.29.4" - account_id = "acc-xxxxxxxx" - vcs_provider_id = "vcs-xxxxxxxx" - vcs_repo { - identifier = "org/repo" - path = "policies/instance" - branch = "dev" - } -} -``` - -## Argument Reference - -* `name` - (Required) The name of a policy group. -* `account_id` - (Optional) The identifier of the Scalr account, in the format `acc-`. -* `vcs_provider_id` - (Required) The identifier of a VCS provider, in the format `vcs-`. -* `vcs_repo` - (Required) Object. The VCS meta-data to create the policy from: - - * `identifier` - (Required) The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider. - * `branch` - (Optional) The branch of a repository the policy group is associated with. If omitted, the repository default branch will be used. - * `path` - (Optional) The subdirectory of the VCS repository where OPA policies are stored. If omitted or submitted as an empty string, this defaults to the repository's root. - -* `opa_version` - (Optional) The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned. - -## Attribute Reference - -All arguments plus: - -* `id` - An identifier of the policy group. -* `status` - A system status of the Policy group. -* `error_message` - A detailed error if Scalr failed to process the policy group. -* `policies` - A list of the OPA policies the group verifies each run. -* `environments` - A list of the environments the policy group is linked to. - -The `policies` list contains definitions of OPA policies in the following form: - -* `name` - A name of the policy. -* `enabled` - If set to `false`, the policy will not be verified during a run. -* `enforced_level` - An enforcement level of the policy. - -## Import - -To import policy groups use the policy group ID as the import ID. For example: - -```shell -terraform import scalr_policy_group.example pgrp-svsu2dqfvtk5qfg -``` diff --git a/docs/resources/scalr_policy_group_linkage.md b/docs/resources/scalr_policy_group_linkage.md deleted file mode 100644 index 9876f0b7..00000000 --- a/docs/resources/scalr_policy_group_linkage.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Resource `scalr_policy_group_linkage` - -Manage policy group to environment linking in Scalr. Create, update and destroy. - -## Example Usage - -```hcl -resource "scalr_policy_group_linkage" "example" { - policy_group_id = "pgrp-xxxxxxxx" - environment_id = "env-xxxxxxxx" -} -``` - -## Argument Reference - -* `policy_group_id` - (Required) ID of the policy group, in the format `pgrp-`. -* `environment_id` - (Required) ID of the environment, in the format `env-`. - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the policy group linkage. - -## Import - -To import policy group linkage use combined ID in the form `/` as the import ID. For example: - -```shell -terraform import scalr_policy_group_linkage.example pgrp-tne44l0u69rmrm8/env-svrdqa8d7mhaimo -``` diff --git a/docs/resources/scalr_provider_configuration.md b/docs/resources/scalr_provider_configuration.md deleted file mode 100644 index 49eb143e..00000000 --- a/docs/resources/scalr_provider_configuration.md +++ /dev/null @@ -1,187 +0,0 @@ - -# Resource `scalr_provider_configuration` - -A provider configuration helps organizations manage provider secrets in a centralized way. -It natively supports the management of the major providers like Scalr, AWS, AzureRM, and Google Cloud Platform, -but also allows registering any custom provider. Please have a look at the basic usage examples for each provider type. - -## Basic Usage - -### Scalr provider: - -```hcl -resource "scalr_provider_configuration" "scalr" { - name = "scalr" - account_id = "acc-xxxxxxxxx" - scalr { - hostname = "scalr.host.example.com" - token = "my-scalr-token" - } -} -``` - -### Aws provider: - -```hcl -resource "scalr_provider_configuration" "aws" { - name = "aws_dev_us_east_1" - account_id = "acc-xxxxxxxxx" - export_shell_variables = false - environments = [scalr_environment.env1.id] - aws { - account_type = "regular" - credentials_type = "access_keys" - secret_key = "my-secret-key" - access_key = "my-access-key" - } -} -``` - -```hcl -resource "scalr_provider_configuration" "oidc" { - name = "oidc_dev_us_east_1" - account_id = "acc-xxxxxxxxx" - export_shell_variables = false - environments = ["*"] - aws { - credentials_type = "oidc" - role_arn = "arn:aws:iam::123456789012:role/scalr-oidc-role" - audience = "aws.scalr-run-workload" - } -} -``` - -To get into more advanced AWS usage please refer to the official [AWS module](https://github.com/Scalr/terraform-scalr-provider-configuration-aws). - -### AzureRM provider: - -```hcl -resource "scalr_provider_configuration" "azurerm" { - name = "azurerm" - account_id = "acc-xxxxxxxxx" - azurerm { - client_id = "my-client-id" - client_secret = "my-client-secret" - subscription_id = "my-subscription-id" - tenant_id = "my-tenant-id" - } -} -``` - -```hcl -resource "scalr_provider_configuration" "azurerm_oidc" { - name = "azurerm" - account_id = "acc-xxxxxxxxx" - azurerm { - auth_type = "oidc" - audience = "scalr-workload-identity" - client_id = "my-client-id" - tenant_id = "my-tenant-id" - subscription_id = "my-subscription-id" - } -} -``` - -### Google provider: - -```hcl -resource "scalr_provider_configuration" "google" { - name = "google_main" - account_id = "acc-xxxxxxxxx" - google { - project = "my-project" - credentials = "my-credentials" - } -} -``` - -```hcl -resource "scalr_provider_configuration" "google" { - name = "google_main" - account_id = "acc-xxxxxxxxx" - google { - auth_type = "oidc" - project = "my-project" - service_account_email = "user@example.com" - workload_provider_name = "projects/123/locations/global/workloadIdentityPools/pool-name/providers/provider-name" - } -} -``` - -### Custom providers: - -```hcl -resource "scalr_provider_configuration" "kubernetes" { - name = "k8s" - account_id = "acc-xxxxxxxxx" - custom { - provider_name = "kubernetes" - argument { - name = "host" - value = "my-host" - description = "The hostname (in form of URI) of the Kubernetes API." - } - argument { - name = "username" - value = "my-username" - } - argument { - name = "password" - value = "my-password" - sensitive = true - } - } -} -``` - -## Argument Reference - -* `account_id` - (Optional) The account that owns the object, specified as an ID. -* `name` - (Required) The name of the Scalr provider configuration. This field is unique for the account. -* `export_shell_variables` - (Optional) Export provider variables into the run environment. This option is available for built-in (Scalr, AWS, AzureRM, Google) providers only. -* `environments` - (Optional) The list of environment identifiers that the provider configuration is shared to. Use `["*"]` to share with all environments. -* `scalr` - (Optional) Settings for the Scalr provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. - The `scalr` block supports the following: - * `hostname` - (Optional) The Scalr hostname which should be used. - * `token` - (Optional) The Scalr token which should be used. -* `aws` - (Optional) Settings for the aws provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. - The `aws` block supports the following: - * `credentials_type` - (Required) The type of AWS credentials, available options: `access_keys`, `role_delegation`, `oidc`. - * `account_type` - (Optional) The type of AWS account, available options: `regular`, `gov-cloud`, `cn-cloud`. - * `trusted_entity_type` - (Optional) Trusted entity type, available options: `aws_account`, `aws_service`. This option is required with `role_delegation` credentials type. - * `role_arn` - (Optional) Amazon Resource Name (ARN) of the IAM Role to assume. This option is required with the `role_delegation` and `oidc` credentials type. - * `external_id` - (Optional) External identifier to use when assuming the role. This option is required with `role_delegation` credentials type and `aws_account` trusted entity type. - * `secret_key` - (Optional) AWS secret key. This option is required with `access_keys` credentials type. - * `access_key` - (Optional) AWS access key. This option is required with `access_keys` credentials type. - * `audience` - (Optional) The value of the `aud` claim for the identity token. This option is required with `oidc` credentials type. -* `google` - (Optional) Settings for the google provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. - The `google` block supports the following: - * `auth_type` - (Optional) Authentication type, either `service-account-key` (default) or `oidc`. - * `credentials` - (Optional) Service account key file in JSON format, required when `auth_type` is `service-account-key`. - * `service_account_email` - (Optional) The service account email used to authenticate to GCP, required when `auth_type` is `oidc`. - * `workload_provider_name` - (Optional) The canonical name of the workload identity provider, required when `auth_type` is `oidc`. - * `project` - (Optional) The default project to manage resources in. If another project is specified on a resource, it will take precedence. -* `azurerm` - (Optional) Settings for the azurerm provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. - The `azurerm` block supports the following: - * `auth_type` - (Optional) Authentication type, either `client-secrets` (default) or `oidc`. - * `client_id` - (Required) The Client ID that should be used. - * `client_secret` - (Optional) The Client Secret that should be used, required when `auth_type` is `client-secrets`. - * `tenant_id` - (Required) The Tenant ID that should be used. - * `subscription_id` - (Optional) The Subscription ID that should be used. If skipped, it must be set as a shell variable in the workspace or as a part of the source configuration. - * `audience` - (Optional) The value of the `aud` claim for the identity token. This option is required with `oidc` authentication type. -* `custom` - (Optional) Settings for the provider configuration that does not have scalr support as a built-in provider. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`. - The `custom` block supports the following: - * `provider_name` - (Required) The name of a Terraform provider. - * `argument` - (Required) The provider configuration argument. Multiple instances are allowed per block. - The `argument` block supports the following: - * `name` - (Required) The name of the provider configuration argument. - * `value` - (Optional) The value of the provider configuration argument. - * `sensitive` - (Optional) Set (true/false) to configure as sensitive. Default `false`. - * `description` - (Optional) The description of the provider configuration argument. - - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the provider configuration, in the format `pcfg-xxxxxxxx`. diff --git a/docs/resources/scalr_provider_configuration_default.md b/docs/resources/scalr_provider_configuration_default.md deleted file mode 100644 index 4b7d818f..00000000 --- a/docs/resources/scalr_provider_configuration_default.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Resource `scalr_provider_configuration_default` - -Manage defaults of provider configurations for environments in Scalr. Create and destroy. - -## Basic Usage - -```hcl -resource "scalr_provider_configuration_default" "example" { - environment_id = "env-xxxxxxxx" - provider_configuration_id = "pcfg-xxxxxxxx" -} -``` - -## Argument Reference - -* `environment_id` - (Required) ID of the environment, in the format `env-`. -* `provider_configuration_id` - (Required) ID of the provider configuration, in the format `pcfg-`. - -Note: -To make the provider configuration default, it must be shared with the specified environment. -See the definition of the resource [`scalr_provider_configuration`](scalr_provider_configuration.md) and attribute `environments` to learn more. -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the provider configuration default. - -## Import - -To import provider configuration default use combined ID in the form `/` as the import ID. For example: - -```shell - -terraform import scalr_provider_configuration_default.example env-xxxxxxxx/pcfg-xxxxxxxx - -``` diff --git a/docs/resources/scalr_role.md b/docs/resources/scalr_role.md deleted file mode 100644 index 8277312d..00000000 --- a/docs/resources/scalr_role.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Resource `scalr_role` - -Manage the Scalr IAM roles. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_role" "writer" { - name = "Writer" - account_id = "acc-xxxxxxxx" - description = "Write access to all resources." - - permissions = [ - "*:update", - "*:delete", - "*:create" - ] -} -``` - -## Argument Reference - -* `name` - (Required) Name of the role. -* `account_id` - (Optional) ID of the account. -* `permissions` - (Required) Array of permission names. -* `description` - (Optional) Verbose description of the role. - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the role. -* `is_system` - Boolean indicates if the role can be edited. System roles are maintained by Scalr and cannot be changed. - -## Import - -To import roles use role ID as the import ID. For example: -```shell -terraform import scalr_role.example role-te2cteuismsqocg -``` diff --git a/docs/resources/scalr_run_triggers.md b/docs/resources/scalr_run_triggers.md deleted file mode 100644 index 9e47c03a..00000000 --- a/docs/resources/scalr_run_triggers.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Resource `scalr_run_trigger` - -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 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 triggered. -* `upstream_id` (Required) The identifier of the upstream workspace. - - -## Attribute Reference - -All arguments plus: - -* `id` - The identifier of the created trigger - -## Import - -To import an existing run trigger use its identifier. For example: - -```shell -terraform import scalr_run_trigger.set_downstream rt-xxxxxxxxxx -``` diff --git a/docs/resources/scalr_service_account.md b/docs/resources/scalr_service_account.md deleted file mode 100644 index 714bdd80..00000000 --- a/docs/resources/scalr_service_account.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Resource `scalr_service_account` - -Manages the state of service accounts in Scalr. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_service_account" "example" { - name = "sa-name" - description = "Lorem ipsum" - status = "Active" - account_id = "acc-xxxxxxxxx" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the service account. -* `description` - (Optional) Description of the service account. -* `status` - (Optional) The status of the service account. Valid values are `Active` and `Inactive`. -Defaults to `Active`. -* `account_id` - (Optional) ID of the account, in the format `acc-`. - -## Attributes - -All arguments plus: - -* `id` - The identifier of the service account in the format `sa-`. -* `email` - The email of the service account. -* `created_by` - Details of the user that created the service account. - -The `created_by` block contains: - -* `username` - Username of creator. -* `email` - Email address of creator. -* `full_name` - Full name of creator. diff --git a/docs/resources/scalr_service_account_token.md b/docs/resources/scalr_service_account_token.md deleted file mode 100644 index 06043948..00000000 --- a/docs/resources/scalr_service_account_token.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Resource `scalr_service_account_token` - -Manage the state of service account's tokens in Scalr. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_service_account_token" "default" { - service_account_id = "sa-xxxxxxx" - description = "Some description" -} -``` - -## Argument Reference - -* `service_account_id` - (Required) ID of the service account. -* `description` - (Optional) Description of the token. - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the token. -* `token` - (Sensitive) The token of the service account. diff --git a/docs/resources/scalr_slack_integration.md b/docs/resources/scalr_slack_integration.md deleted file mode 100644 index 9e2584a7..00000000 --- a/docs/resources/scalr_slack_integration.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Resource `scalr_slack_integration` - -Manage the state of Slack integrations in Scalr. Create, update and destroy. -Slack workspace should be connected to Scalr account before using this resource. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_slack_integration" "test" { - name = "my-channel" - account_id = "acc-xxxx" - events = ["run_approval_required", "run_success", "run_errored"] - channel_id = "xxxx" # Can be found in slack UI (channel settings/info popup) - environments = ["env-xxxxx"] - workspaces = ["ws-xxxx", "ws-xxxx"] -} -``` - -## Argument Reference - -* `name` - (Required) Name of the Slack integration. -* `channel_id` - (Required) Slack channel ID the event will be sent to. -* `events` - (Required) Terraform run events you would like to receive a Slack notifications for. -Supported values are `run_approval_required`, `run_success`, `run_errored`. -* `environments` - (Required) List of environments where events should be triggered. -* `workspaces` - (Optional) List of workspaces where events should be triggered. -Workspaces should be in provided environments. If no workspace is given for a specified environment, -events will trigger in all of its workspaces. -* `account_id` - (Optional) ID of the account. - - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the Slack integration. diff --git a/docs/resources/scalr_tag.md b/docs/resources/scalr_tag.md deleted file mode 100644 index fa29c22c..00000000 --- a/docs/resources/scalr_tag.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Resource `scalr_tag` - -Manages the state of tags in Scalr. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_tag" "example" { - name = "tag-name" - account_id = "acc-xxxxxxxxx" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the tag. -* `account_id` - (Optional) ID of the account, in the format `acc-`. - -## Attributes - -All arguments plus: - -* `id` - The identifier of the tag in the format `tag-`. diff --git a/docs/resources/scalr_variable.md b/docs/resources/scalr_variable.md deleted file mode 100644 index dbe57a0e..00000000 --- a/docs/resources/scalr_variable.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Resource `scalr_variable - -Manage the state of variables in Scalr. Creates, updates and destroys. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_workspace" "example" { - name = "my-workspace-name" - environment_id = "env-xxxxxxxxxx" -} - -resource "scalr_variable" "example" { - key = "my_key_name" - value = "my_value_name" - category = "terraform" - description = "variable description" - workspace_id = scalr_workspace.example.id -} -``` - -Adding Complex Type Variable: - -```hcl -resource "scalr_variable" "example" { - key = "xyz" - value = jsonencode(["foo", "bar"]) - hcl = true - category = "terraform" - workspace_id = scalr_workspace.example.id -} -``` - -## Argument Reference - -* `key` - (Required) Key of the variable. -* `value` - (Required) Variable value. -* `category` - (Required) Indicates if this is a Terraform or shell variable. Allowed values are `terraform` or `shell`. -* `description` - (Optional) Variable verbose description, defaults to empty string. -* `hcl` - (Optional) Set (true/false) to configure the variable as a string of HCL code. Has no effect for `category = "shell"` variables. Default `false`. -* `sensitive` - (Optional) Set (true/false) to configure as sensitive. Sensitive variable values are not visible after being set. Default `false`. -* `final` - (Optional) Set (true/false) to configure as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. Default `false`. -* `force` - (Optional) Set (true/false) to configure as force. Allows creating final variables on higher scope, even if the same variable exists on lower scope (lower is to be deleted). Default `false`. -* `workspace_id` - (Optional) The workspace that owns the variable, specified as an ID, in the format `ws-`. -* `environment_id` - (Optional) The environment that owns the variable, specified as an ID, in the format `env-`. -* `account_id` - (Optional) The account that owns the variable, specified as an ID, in the format `acc-`. - - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the variable, in the format `var-`. - -## Import - -To import variables use `//` as the import ID. For example: - -```shell -terraform import scalr_variable.example environment-name/workspace-name/var-xxxxxxxxxxxx -``` diff --git a/docs/resources/scalr_vcs_provider.md b/docs/resources/scalr_vcs_provider.md deleted file mode 100644 index 001ca985..00000000 --- a/docs/resources/scalr_vcs_provider.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Resource `scalr_vcs_provider` - -Manage the Scalr VCS provider. Create, update and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_vcs_provider" "example" { - name="example-github" - account_id = "acc-xxxxx" - vcs_type="github" - token="token" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the vcs provider. -* `vcs_type` (Required) The vcs provider type is one of `github`, `github_enterprise`, `gitlab`, `gitlab_enterprise`, `bitbucket_enterprise`. - The other providers are not currently supported in the resource. -* `token` (Required) The personal access token for the provider - * GitHub token can be generated by url https://github.com/settings/tokens/new?description=example-vcs-resouce&scopes=repo - * Gitlab token can be generated by url https://gitlab.com/-/profile/personal_access_tokens?name=example-vcs-resouce&scopes=api,read_user,read_registry -* `account_id` - (Optional) ID of the account. -* `url` - (Optional) This field is required for self-hosted vcs providers. -* `username` - (Optional) This field is required for `bitbucket_enterprise` provider type. -* `agent_pool_id` - (Optional) The id of the agent pool to connect Scalr to self-hosted VCS provider. -* `environments` - (Optional) The list of environment identifiers that the VCS provider is shared to. - Use `["*"]` to share with all environments. - - -## Attribute Reference - -All arguments plus: - -* `id` - The ID of the vcs provider. - -## Import - -To import vcs provider use vcs provider ID as the import ID. For example: - -```shell -terraform import scalr_vcs_provider.example vcs-xxxxxxxxxx -``` diff --git a/docs/resources/scalr_webhook.md b/docs/resources/scalr_webhook.md deleted file mode 100644 index 5e50b2ec..00000000 --- a/docs/resources/scalr_webhook.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Resource `scalr_webhook` - -Manage the state of webhooks in Scalr. Creates, updates and destroy. - -## Example Usage - -Basic usage: - -```hcl -resource "scalr_webhook" "example" { - name = "my-webhook-name" - enabled = true - endpoint_id = "ep-xxxxxxxxxx" - events = ["run:completed", "run:errored"] - workspace_id = "ws-xxxxxxxxxx" - environment_id = "env-xxxxxxxxxx" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the webhook. -* `account_id` - (Optional) ID of the account, in the format `acc-`. -* `enabled` - (Optional) Set (true/false) to enable/disable the webhook. -* `endpoint_id` - (Deprecated) ID of the endpoint, in the format `ep-`. -* `workspace_id` - (Deprecated) ID of the workspace, in the format `ws-`. -* `environment_id` - (Deprecated) ID of the environment, in the format `env-`. -* `events` - (Required) List of event IDs. -* `url` - (Optional) Endpoint URL. Required if `endpoint_id` is not set. -* `secret_key` - (Optional) Secret key to sign the webhook payload. -* `max_attempts` - (Optional) Max delivery attempts of the payload. -* `timeout` - (Optional) Endpoint timeout (in seconds). -* `environments` - (Optional) The list of environment identifiers that the webhook is shared to. -Use `["*"]` to share with all environments. -* `header` - (Optional, set of header objects) Additional headers to set in the webhook request. - The `header` block item contains: - * `name` - The name of the header. - * `value` - The value of the header. - -## Attributes - -All arguments plus: - -* `id` - The webhook ID, in the format `wh-`. -* `last_triggered_at` - Date/time when webhook was last triggered. diff --git a/docs/resources/scalr_workspace.md b/docs/resources/scalr_workspace.md deleted file mode 100644 index 1790407a..00000000 --- a/docs/resources/scalr_workspace.md +++ /dev/null @@ -1,162 +0,0 @@ - -# Resource `scalr_workspace` - -Manage the state of workspaces in Scalr. Create, update and destroy - -## Example Usage - -Basic usage: - -### VCS-driven -```hcl -data "scalr_vcs_provider" test { - name = "vcs-name" - account_id = "acc-xxxx" # in case if user has access to more than one account -} - -data "scalr_environment" test { - name = "env-name" - account_id = "acc-xxxx" # in case if a user has access to more than one account -} - -resource "scalr_workspace" "vcs-driven" { - name = "my-workspace-name" - environment_id = data.scalr_environment.test.id - vcs_provider_id = data.scalr_vcs_provider.test.id - - working_directory = "example/path" - - vcs_repo { - identifier = "org/repo" - branch = "dev" - trigger_prefixes = ["stage", "prod"] - } - - provider_configuration { - id = "pcfg-1" - alias = "us_east1" - } - provider_configuration { - id = "pcfg-2" - alias = "us_east2" - } -} -``` - -### Module-driven - -```hcl -data "scalr_environment" test { - name = "env-name" - # account_id = "acc-xxxx" # Optional, in case if user has access to more than one account -} - -locals { - modules = { - "${data.scalr_environment.test.id}": "module-name/provider", # environment-level module will be selected - "${data.scalr_environment.test.account_id}": "module-name/provider", # account-level module will be selected - } -} - -data "scalr_module_version" "module-driven" { - for_each = local.modules - source = "${each.key}/${each.value}" - # version = "1.0.0" # Optional, if omitted, the latest module version is selected -} - -resource "scalr_workspace" "example" { - for_each = data.scalr_module_version.example - environment_id = data.scalr_environment.test.id - - name = replace(each.value.source, "/", "-") - module_version_id = each.value.id -} -``` - -### CLI-driven - -```hcl -data "scalr_environment" test { - name = "env-name" - # account_id = "acc-xxxx" # Optional, in case if user has access to more than one account -} - -resource "scalr_workspace" "cli-driven" { - name = "my-workspace-name" - environment_id = data.scalr_environment.test.id - - working_directory = "example/path" -} -``` - -## Argument Reference - -* `name` - (Required) Name of the workspace. -* `environment_id` - (Required) ID of the environment, in the format `env-`. -* `auto_apply` - (Optional) Set (true/false) to configure if `terraform apply` should automatically run when `terraform plan` ends without error. Default `false`. -* `force_latest_run` - (Optional) Set (true/false) to configure if latest new run will be automatically raised in priority. Default `false`. -* `deletion_protection_enabled` - (Optional) Indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed. Default `true`. -* `operations` - Deprecated. Use `execution_mode` instead. -* `auto_queue_runs` - Indicates if runs have to be queued automatically when a new configuration version is uploaded. - - Supported values are `skip_first`, `always`, `never`: - - * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior. - * `always` - runs will be triggered automatically on every upload of the configuration version. - * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered. - -* `execution_mode` - (Optional) Which execution mode to use. Valid values are `remote` and `local`. When set to `local`, the workspace will be used for state storage only. Defaults to `remote` (not set, backend default is used). -* `terraform_version` - (Optional) The version of Terraform to use for this workspace. Defaults to the latest available version. -* `working_directory` - (Optional) A relative path that Terraform will be run in. Defaults to the root of the repository `""`. -* `var_files` - (Optional) A list of paths to the `.tfvars` file(s) to be used as part of the workspace configuration. -* `run_operation_timeout` - (Optional) The number of minutes run operation can be executed before termination. Defaults to `0` (not set, backend default is used). -* `module_version_id` - (Optional) The identifier of a module version in the format `modver-`. This attribute conflicts with `vcs_provider_id` and `vcs_repo` attributes. -* `agent_pool_id` - (Optional) The identifier of an agent pool in the format `apool-`. -* `tag_ids` - (Optional) List of tag IDs associated with the workspace. -* `vcs_provider_id` - (Optional) ID of vcs provider - required if vcs-repo present and vice versa, in the format `vcs-` -* `vcs_repo` - (Optional) Settings for the workspace's VCS repository. - - The `vcs_repo` block supports: - * `identifier` - (Required) A reference to your VCS repository in the format `:org/:repo`, it refers to the organization and repository in your VCS provider. - * `branch` - (Optional) The repository branch where Terraform will be run from. Default `master`. - * `path` - (Optional) `Deprecated`: The repository subdirectory that Terraform will execute from. If omitted or submitted as an empty string, this defaults to the repository's root. - * `trigger_prefixes` - (Optional) List of paths (relative to `path`), whose changes will trigger a run for the workspace using this binding when the CV is created. If omitted or submitted as an empty list, any change in `path` will trigger a new run. - * `dry_runs_enabled` - (Optional) Set (true/false) to configure the VCS driven dry runs should run when pull request to configuration versions branch created. Default `true` - * `ingress_submodules` - (Optional) Designates whether to clone git submodules of the VCS repository. - -* `hooks` - (Optional) Settings for the workspaces custom hooks. - - The `hooks` block supports: - * `pre_init` - (Optional) Action that will be called before the init phase - * `pre_plan` - (Optional) Action that will be called before the plan phase - * `post_plan` - (Optional) Action that will be called after plan phase - * `pre_apply` - (Optional) Action that will be called before apply phase - * `post_apply` - (Optional) Action that will be called after apply phase - -* `provider_configuration` - (Optional) Provider configurations used in workspace runs. - - The `provider_configuration` block supports: - * `id` - (Required) The identifier of provider configuration - * `alias` - (Optional) The alias of provider configuration - -## Attribute Reference - -All arguments plus: - -* `id` - The workspace ID, in the format `ws-`. -* `created_by` - Details of the user that created the workspace. -* `has_resources` - The presence of active terraform resources in the current state version. - -The `created_by` block contains: - -* `username` - Username of creator. -* `email` - Email address of creator. -* `full_name` - Full name of creator. - -## Import - -To import workspaces use workspace ID as the import ID. For example: - -```shell -terraform import scalr_workspace.example ws-t47s1aa6s4boubg -``` diff --git a/docs/resources/scalr_workspace_run_schedule.md b/docs/resources/scalr_workspace_run_schedule.md deleted file mode 100644 index 14cbdb1e..00000000 --- a/docs/resources/scalr_workspace_run_schedule.md +++ /dev/null @@ -1,40 +0,0 @@ - -# scalr_workspace_run_schedule Resource - -Allows workspace admins to automate the configuration of recurring runs for a workspace. - -## Example Usage - -Basic usage: - -```hcl -data scalr_environment "current" { - account_id = "acc-12345" - name = "dev" -} - -data "scalr_workspace" "cert" { - environment_id = data.scalr_environment.current.id - name = "ssl-certificates" -} - -resource "scalr_workspace_run_schedule" "example" { - workspace_id = data.scalr_workspace.cert.id - apply_schedule = "30 3 5 3-5 2" - destroy_schedule = "30 4 5 3-5 2" -} -``` - -## Argument Reference - -* `workspace_id` - (Required) ID of the workspace, in the format `ws-`. -* `apply_schedule` - (Optional) Cron expression for when apply run should be created. -* `destroy_schedule` - (Optional) Cron expression for when destroy run should be created. - - -## Attribute Reference - -All arguments plus: - -* `id` - The identifier of a workspace in the format `ws-`. - diff --git a/docs/resources/service_account.md b/docs/resources/service_account.md new file mode 100644 index 00000000..1a3a339f --- /dev/null +++ b/docs/resources/service_account.md @@ -0,0 +1,58 @@ +--- +title: "scalr_service_account" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_service_account" +parentDocSlug: "provider_resources" +hidden: false +order: 15 +--- +## Resource Overview + +Manages the state of service accounts in Scalr. + +## Example Usage + +```terraform +resource "scalr_service_account" "example" { + name = "sa-name" + description = "Lorem ipsum" + status = "Active" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the service account. + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `description` (String) Description of the service account. +- `status` (String) The status of the service account. Valid values are `Active` and `Inactive`. Defaults to `Active`. + +### Read-Only + +- `created_by` (List of Object) Details of the user that created the service account. (see [below for nested schema](#nestedatt--created_by)) +- `email` (String) The email of the service account. +- `id` (String) The ID of this resource. + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) +- `full_name` (String) +- `username` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_service_account.example sa-xxxxxxxxxx +``` diff --git a/docs/resources/service_account_token.md b/docs/resources/service_account_token.md new file mode 100644 index 00000000..783f7f28 --- /dev/null +++ b/docs/resources/service_account_token.md @@ -0,0 +1,36 @@ +--- +title: "scalr_service_account_token" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_service_account_token" +parentDocSlug: "provider_resources" +hidden: false +order: 16 +--- +## Resource Overview + +Manage the state of service account's tokens in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_service_account_token" "default" { + service_account_id = "sa-xxxxxxxxxx" + description = "Some description" +} +``` + + +## Schema + +### Required + +- `service_account_id` (String) ID of the service account. + +### Optional + +- `description` (String) Description of the token. + +### Read-Only + +- `id` (String) The ID of this resource. +- `token` (String, Sensitive) The token of the service account. diff --git a/docs/resources/slack_integration.md b/docs/resources/slack_integration.md new file mode 100644 index 00000000..d138db70 --- /dev/null +++ b/docs/resources/slack_integration.md @@ -0,0 +1,53 @@ +--- +title: "scalr_slack_integration" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_slack_integration" +parentDocSlug: "provider_resources" +hidden: false +order: 17 +--- +## Resource Overview + +Manage the state of Slack integrations in Scalr. Create, update and destroy. + +**Note:** Slack workspace should be connected to Scalr account before using this resource. + +## Example Usage + +```terraform +resource "scalr_slack_integration" "test" { + name = "my-channel" + account_id = "acc-xxxxxxxxxx" + events = ["run_approval_required", "run_success", "run_errored"] + channel_id = "xxxxxxxxxx" # Can be found in slack UI (channel settings/info popup) + environments = ["env-xxxxxxxxxx"] + workspaces = ["ws-xxxxxxxxxx", "ws-yyyyyyyyyy"] +} +``` + + +## Schema + +### Required + +- `channel_id` (String) Slack channel ID the event will be sent to. +- `environments` (Set of String) List of environments where events should be triggered. +- `events` (Set of String) Terraform run events you would like to receive a Slack notifications for. Supported values are `run_approval_required`, `run_success`, `run_errored`. +- `name` (String) Name of the Slack integration. + +### Optional + +- `account_id` (String) ID of the account. +- `workspaces` (Set of String) List of workspaces where events should be triggered. Workspaces should be in provided environments. If no workspace is given for a specified environment, events will trigger in all of its workspaces. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_slack_integration.example in-xxxxxxxxxx +``` diff --git a/docs/resources/tag.md b/docs/resources/tag.md new file mode 100644 index 00000000..560a292c --- /dev/null +++ b/docs/resources/tag.md @@ -0,0 +1,43 @@ +--- +title: "scalr_tag" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_tag" +parentDocSlug: "provider_resources" +hidden: false +order: 18 +--- +## Resource Overview + +Manages the state of tags in Scalr. + +## Example Usage + +```terraform +resource "scalr_tag" "example" { + name = "tag-name" + account_id = "acc-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the tag. + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_tag.example tag-xxxxxxxxxx +``` diff --git a/docs/resources/variable.md b/docs/resources/variable.md new file mode 100644 index 00000000..76508b93 --- /dev/null +++ b/docs/resources/variable.md @@ -0,0 +1,63 @@ +--- +title: "scalr_variable" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_variable" +parentDocSlug: "provider_resources" +hidden: false +order: 19 +--- +## Resource Overview + +Manage the state of the variables in Scalr. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_variable" "example1" { + key = "my_key_name" + value = "my_value_name" + category = "terraform" + description = "variable description" + workspace_id = "ws-xxxxxxxxxx" +} + +resource "scalr_variable" "example2" { + key = "xyz" + value = jsonencode(["foo", "bar"]) + hcl = true + category = "terraform" + workspace_id = "ws-yyyyyyyyyy" +} +``` + + +## Schema + +### Required + +- `category` (String) Indicates if this is a Terraform or shell variable. Allowed values are `terraform` or `shell`. +- `key` (String) Key of the variable. + +### Optional + +- `account_id` (String) The account that owns the variable, specified as an ID, in the format `acc-`. +- `description` (String) Variable verbose description, defaults to empty string. +- `environment_id` (String) The environment that owns the variable, specified as an ID, in the format `env-`. +- `final` (Boolean) Set (true/false) to configure as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. Default `false`. +- `force` (Boolean) Set (true/false) to configure as force. Allows creating final variables on higher scope, even if the same variable exists on lower scope (lower is to be deleted). Default `false`. +- `hcl` (Boolean) Set (true/false) to configure the variable as a string of HCL code. Has no effect for `category = "shell"` variables. Default `false`. +- `sensitive` (Boolean) Set (true/false) to configure as sensitive. Sensitive variable values are not visible after being set. Default `false`. +- `value` (String, Sensitive) Variable value. +- `workspace_id` (String) The workspace that owns the variable, specified as an ID, in the format `ws-`. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_variable.example var-xxxxxxxxxx +``` diff --git a/docs/resources/vcs_provider.md b/docs/resources/vcs_provider.md new file mode 100644 index 00000000..2aed70f8 --- /dev/null +++ b/docs/resources/vcs_provider.md @@ -0,0 +1,53 @@ +--- +title: "scalr_vcs_provider" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_vcs_provider" +parentDocSlug: "provider_resources" +hidden: false +order: 20 +--- +## Resource Overview + +Manage the Scalr VCS provider. Create, update and destroy. + +## Example Usage + +```terraform +resource "scalr_vcs_provider" "example" { + name = "example-github" + account_id = "acc-xxxxxxxxxx" + vcs_type = "github" + token = "token" +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the vcs provider. +- `token` (String, Sensitive) The personal access token for the provider. + * GitHub token can be generated by url https://github.com/settings/tokens/new?description=example-vcs-resouce&scopes=repo + * Gitlab token can be generated by url https://gitlab.com/-/profile/personal_access_tokens?name=example-vcs-resouce&scopes=api,read_user,read_registry +- `vcs_type` (String) The vcs provider type is one of `github`, `github_enterprise`, `gitlab`, `gitlab_enterprise`, `bitbucket_enterprise`. The other providers are not currently supported in the resource. + +### Optional + +- `account_id` (String) ID of the account. +- `agent_pool_id` (String) The id of the agent pool to connect Scalr to self-hosted VCS provider. +- `environments` (Set of String) The list of environment identifiers that the VCS provider is shared to. Use `["*"]` to share with all environments. +- `url` (String) This field is required for self-hosted vcs providers. +- `username` (String) This field is required for `bitbucket_enterprise` provider type. + +### Read-Only + +- `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_vcs_provider.example vcs-xxxxxxxxxx +``` diff --git a/docs/resources/webhook.md b/docs/resources/webhook.md new file mode 100644 index 00000000..f96ddaa8 --- /dev/null +++ b/docs/resources/webhook.md @@ -0,0 +1,87 @@ +--- +title: "scalr_webhook" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_webhook" +parentDocSlug: "provider_resources" +hidden: false +order: 21 +--- +## Resource Overview + +Manage the state of webhooks in Scalr. Creates, updates and destroy. + +## Example Usage + +```terraform +resource "scalr_webhook" "example1" { + name = "my-webhook-1" + enabled = true + url = "https://my-endpoint.url" + secret_key = "my-secret-key" + timeout = 15 + max_attempts = 3 + events = ["run:completed", "run:errored"] + environments = ["env-xxxxxxxxxx"] + header { + name = "header1" + value = "value1" + } + header { + name = "header2" + value = "value2" + } +} + +# Old-style webhook resource (deprecated): +resource "scalr_webhook" "example2" { + name = "my-webhook-2" + enabled = true + endpoint_id = "ep-xxxxxxxxxx" + events = ["run:completed", "run:errored"] + workspace_id = "ws-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" +} +``` + + +## Schema + +### Required + +- `events` (List of String) List of event IDs. +- `name` (String) Name of the webhook. + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `enabled` (Boolean) Set (true/false) to enable/disable the webhook. +- `endpoint_id` (String, Deprecated) ID of the endpoint, in the format `ep-`. +- `environment_id` (String, Deprecated) ID of the environment, in the format `env-`. +- `environments` (Set of String) The list of environment identifiers that the webhook is shared to. Use `["*"]` to share with all environments. +- `header` (Block Set) Additional headers to set in the webhook request. (see [below for nested schema](#nestedblock--header)) +- `max_attempts` (Number) Max delivery attempts of the payload. +- `secret_key` (String, Sensitive) Secret key to sign the webhook payload. +- `timeout` (Number) Endpoint timeout (in seconds). +- `url` (String) Endpoint URL. Required if `endpoint_id` is not set. +- `workspace_id` (String, Deprecated) ID of the workspace, in the format `ws-`. + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_triggered_at` (String) Date/time when webhook was last triggered. + + +### Nested Schema for `header` + +Required: + +- `name` (String) The name of the header. +- `value` (String) The value of the header. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_webhook.example wh-xxxxxxxxxx +``` diff --git a/docs/resources/workspace.md b/docs/resources/workspace.md new file mode 100644 index 00000000..ae84871d --- /dev/null +++ b/docs/resources/workspace.md @@ -0,0 +1,212 @@ +--- +title: "scalr_workspace" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_workspace" +parentDocSlug: "provider_resources" +hidden: false +order: 22 +--- +## Resource Overview + +Manage the state of workspaces in Scalr. Create, update and destroy. + +## Example Usage + +### VCS-driven + +```terraform +data "scalr_vcs_provider" "example" { + name = "vcs-name" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_environment" "example" { + name = "env-name" + account_id = "acc-xxxxxxxxxx" +} + +resource "scalr_workspace" "example" { + name = "my-workspace-name" + environment_id = data.scalr_environment.example.id + vcs_provider_id = data.scalr_vcs_provider.example.id + + working_directory = "example/path" + + vcs_repo { + identifier = "org/repo" + branch = "dev" + trigger_prefixes = ["stage", "prod"] + } + + provider_configuration { + id = "pcfg-xxxxxxxxxx" + alias = "us_east1" + } + provider_configuration { + id = "pcfg-yyyyyyyyyy" + alias = "us_east2" + } +} +``` + +### Module-driven + +```terraform +data "scalr_environment" "example" { + name = "env-name" + account_id = "acc-xxxxxxxxxx" +} + +locals { + modules = { + "${data.scalr_environment.example.id}" : "module-name/provider", # environment-level module will be selected + "${data.scalr_environment.example.account_id}" : "module-name/provider", # account-level module will be selected + } +} + +data "scalr_module_version" "example" { + for_each = local.modules + source = "${each.key}/${each.value}" +} + +resource "scalr_workspace" "example" { + for_each = data.scalr_module_version.example + environment_id = data.scalr_environment.example.id + + name = replace(each.value.source, "/", "-") + module_version_id = each.value.id +} +``` + +### CLI-driven + +```terraform +data "scalr_environment" "example" { + name = "env-name" + account_id = "acc-xxxxxxxxxx" +} + +resource "scalr_workspace" "example" { + name = "my-workspace-name" + environment_id = data.scalr_environment.example.id + working_directory = "example/path" +} +``` + +### Create tagged workspaces + +```terraform +resource "scalr_tag" "team-a" { + name = "TeamA" +} + +resource "scalr_tag" "team-b" { + name = "TeamB" +} + +resource "scalr_workspace" "example-a" { + environment_id = "env-xxxxxxxxxx" + name = "example-a" + tag_ids = [scalr_tag.team-a.id] +} + +resource "scalr_workspace" "example-b" { + environment_id = "env-xxxxxxxxxx" + name = "example-b" + tag_ids = [scalr_tag.team-b.id] +} +``` + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. +- `name` (String) Name of the workspace. + +### Optional + +- `agent_pool_id` (String) The identifier of an agent pool in the format `apool-`. +- `auto_apply` (Boolean) Set (true/false) to configure if `terraform apply` should automatically run when `terraform plan` ends without error. Default `false`. +- `auto_queue_runs` (String) Indicates if runs have to be queued automatically when a new configuration version is uploaded. Supported values are `skip_first`, `always`, `never`: + * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior. + * `always` - runs will be triggered automatically on every upload of the configuration version. + * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered. +- `deletion_protection_enabled` (Boolean) Indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed. Default `true`. +- `execution_mode` (String) Which execution mode to use. Valid values are `remote` and `local`. When set to `local`, the workspace will be used for state storage only. Defaults to `remote` (not set, backend default is used). +- `force_latest_run` (Boolean) Set (true/false) to configure if latest new run will be automatically raised in priority. Default `false`. +- `hooks` (Block List) Settings for the workspaces custom hooks. (see [below for nested schema](#nestedblock--hooks)) +- `module_version_id` (String) The identifier of a module version in the format `modver-`. This attribute conflicts with `vcs_provider_id` and `vcs_repo` attributes. +- `operations` (Boolean, Deprecated) Set (true/false) to configure workspace remote execution. When `false` workspace is only used to store state. Defaults to `true`. +- `provider_configuration` (Block Set) Provider configurations used in workspace runs. (see [below for nested schema](#nestedblock--provider_configuration)) +- `run_operation_timeout` (Number) The number of minutes run operation can be executed before termination. Defaults to `0` (not set, backend default is used). +- `tag_ids` (Set of String) List of tag IDs associated with the workspace. +- `terraform_version` (String) The version of Terraform to use for this workspace. Defaults to the latest available version. +- `var_files` (List of String) A list of paths to the `.tfvars` file(s) to be used as part of the workspace configuration. +- `vcs_provider_id` (String) ID of VCS provider - required if vcs-repo present and vice versa, in the format `vcs-`. +- `vcs_repo` (Block List, Max: 1) Settings for the workspace's VCS repository. (see [below for nested schema](#nestedblock--vcs_repo)) +- `working_directory` (String) A relative path that Terraform will be run in. Defaults to the root of the repository `""`. + +### Read-Only + +- `created_by` (List of Object) Details of the user that created the workspace. (see [below for nested schema](#nestedatt--created_by)) +- `has_resources` (Boolean) The presence of active terraform resources in the current state version. +- `id` (String) The ID of this resource. + + +### Nested Schema for `hooks` + +Optional: + +- `post_apply` (String) Action that will be called after apply phase. +- `post_plan` (String) Action that will be called after plan phase. +- `pre_apply` (String) Action that will be called before apply phase. +- `pre_init` (String) Action that will be called before the init phase. +- `pre_plan` (String) Action that will be called before the plan phase. + + + +### Nested Schema for `provider_configuration` + +Required: + +- `id` (String) The identifier of provider configuration. + +Optional: + +- `alias` (String) The alias of provider configuration. + + + +### Nested Schema for `vcs_repo` + +Required: + +- `identifier` (String) A reference to your VCS repository in the format `:org/:repo`, it refers to the organization and repository in your VCS provider. + +Optional: + +- `branch` (String) The repository branch where Terraform will be run from. If omitted, the repository default branch will be used. +- `dry_runs_enabled` (Boolean) Set (true/false) to configure the VCS driven dry runs should run when pull request to configuration versions branch created. Default `true`. +- `ingress_submodules` (Boolean) Designates whether to clone git submodules of the VCS repository. +- `path` (String, Deprecated) The repository subdirectory that Terraform will execute from. If omitted or submitted as an empty string, this defaults to the repository's root. +- `trigger_prefixes` (List of String) List of paths (relative to `path`), whose changes will trigger a run for the workspace using this binding when the CV is created. If omitted or submitted as an empty list, any change in `path` will trigger a new run. + + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) +- `full_name` (String) +- `username` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_workspace.example ws-xxxxxxxxxx +``` diff --git a/docs/resources/workspace_run_schedule.md b/docs/resources/workspace_run_schedule.md new file mode 100644 index 00000000..c3420beb --- /dev/null +++ b/docs/resources/workspace_run_schedule.md @@ -0,0 +1,45 @@ +--- +title: "scalr_workspace_run_schedule" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_scalr_workspace_run_schedule" +parentDocSlug: "provider_resources" +hidden: false +order: 23 +--- +## Resource Overview + +Allows workspace admins to automate the configuration of recurring runs for a workspace. + +## Example Usage + +```terraform +resource "scalr_workspace_run_schedule" "example" { + workspace_id = "ws-xxxxxxxxxx" + apply_schedule = "30 3 5 3-5 2" + destroy_schedule = "30 4 5 3-5 2" +} +``` + + +## Schema + +### Required + +- `workspace_id` (String) ID of the workspace, in the format `ws-`. + +### Optional + +- `apply_schedule` (String) Cron expression for when apply run should be created. +- `destroy_schedule` (String) Cron expression for when destroy run should be created. + +### Read-Only + +- `id` (String) The ID of this resource. Equals to the ID of the workspace. + +## Import + +Import is supported using the following syntax: + +```shell +terraform import scalr_workspace_run_schedule.example ws-xxxxxxxxxx +``` diff --git a/examples/data-sources/scalr_access_policy/data-source.tf b/examples/data-sources/scalr_access_policy/data-source.tf new file mode 100644 index 00000000..f06bf6b5 --- /dev/null +++ b/examples/data-sources/scalr_access_policy/data-source.tf @@ -0,0 +1,11 @@ +data "scalr_access_policy" "example" { + id = "ap-xxxxxxxxxx" +} + +output "scope_id" { + value = data.scalr_access_policy.example.scope[0].id +} + +output "subject_id" { + value = data.scalr_access_policy.example.subject[0].id +} diff --git a/examples/data-sources/scalr_agent_pool/data-source.tf b/examples/data-sources/scalr_agent_pool/data-source.tf new file mode 100644 index 00000000..34058e9a --- /dev/null +++ b/examples/data-sources/scalr_agent_pool/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_agent_pool" "example1" { + id = "apool-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_agent_pool" "example2" { + name = "default-pool" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_current_account/data-source.tf b/examples/data-sources/scalr_current_account/data-source.tf new file mode 100644 index 00000000..1f7b8d60 --- /dev/null +++ b/examples/data-sources/scalr_current_account/data-source.tf @@ -0,0 +1 @@ +data "scalr_current_account" "account" {} diff --git a/examples/data-sources/scalr_current_run/data-source.tf b/examples/data-sources/scalr_current_run/data-source.tf new file mode 100644 index 00000000..2cb33652 --- /dev/null +++ b/examples/data-sources/scalr_current_run/data-source.tf @@ -0,0 +1 @@ +data "scalr_current_run" "example" {} diff --git a/examples/data-sources/scalr_endpoint/data-source.tf b/examples/data-sources/scalr_endpoint/data-source.tf new file mode 100644 index 00000000..0acbb099 --- /dev/null +++ b/examples/data-sources/scalr_endpoint/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_endpoint" "example1" { + id = "ep-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_endpoint" "example2" { + name = "endpoint_name" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_environment/data-source.tf b/examples/data-sources/scalr_environment/data-source.tf new file mode 100644 index 00000000..e6867784 --- /dev/null +++ b/examples/data-sources/scalr_environment/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_environment" "example1" { + id = "env-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_environment" "example2" { + name = "environment-name" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_environments/data-source.tf b/examples/data-sources/scalr_environments/data-source.tf new file mode 100644 index 00000000..646449be --- /dev/null +++ b/examples/data-sources/scalr_environments/data-source.tf @@ -0,0 +1,15 @@ +data "scalr_environments" "exact-names" { + name = "in:production,development" +} + +data "scalr_environments" "app-frontend" { + name = "like:app-frontend-" +} + +data "scalr_environments" "tagged" { + tag_ids = ["tag-xxxxxxxxxx", "tag-yyyyyyyyyy"] +} + +data "scalr_environments" "all" { + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_iam_team/data-source.tf b/examples/data-sources/scalr_iam_team/data-source.tf new file mode 100644 index 00000000..2d1b9ff2 --- /dev/null +++ b/examples/data-sources/scalr_iam_team/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_iam_team" "example1" { + id = "team-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_iam_team" "example2" { + name = "dev" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_iam_user/data-source.tf b/examples/data-sources/scalr_iam_user/data-source.tf new file mode 100644 index 00000000..23524130 --- /dev/null +++ b/examples/data-sources/scalr_iam_user/data-source.tf @@ -0,0 +1,7 @@ +data "scalr_iam_user" "example1" { + id = "user-xxxxxxxxxx" +} + +data "scalr_iam_user" "example2" { + email = "user@test.com" +} diff --git a/examples/data-sources/scalr_module_version/data-source.tf b/examples/data-sources/scalr_module_version/data-source.tf new file mode 100644 index 00000000..f8f6c611 --- /dev/null +++ b/examples/data-sources/scalr_module_version/data-source.tf @@ -0,0 +1,4 @@ +data "scalr_module_version" "example" { + source = "env-xxxxxxxxxx/resource-name/scalr" + version = "1.0.0" +} diff --git a/examples/data-sources/scalr_policy_group/data-source.tf b/examples/data-sources/scalr_policy_group/data-source.tf new file mode 100644 index 00000000..fd02ef98 --- /dev/null +++ b/examples/data-sources/scalr_policy_group/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_policy_group" "example1" { + id = "pgrp-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_policy_group" "example2" { + name = "instance_types" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_provider_configuration/data-source.tf b/examples/data-sources/scalr_provider_configuration/data-source.tf new file mode 100644 index 00000000..78d9612e --- /dev/null +++ b/examples/data-sources/scalr_provider_configuration/data-source.tf @@ -0,0 +1,11 @@ +data "scalr_provider_configuration" "aws" { + id = "pcfg-xxxxxxxxxx" +} + +data "scalr_provider_configuration" "aws_dev" { + name = "aws_dev" +} + +data "scalr_provider_configuration" "azure" { + provider_name = "azurerm" +} diff --git a/examples/data-sources/scalr_provider_configurations/data-source.tf b/examples/data-sources/scalr_provider_configurations/data-source.tf new file mode 100644 index 00000000..c5228b9e --- /dev/null +++ b/examples/data-sources/scalr_provider_configurations/data-source.tf @@ -0,0 +1,7 @@ +data "scalr_provider_configurations" "aws" { + name = "in:aws_dev,aws_demo,aws_prod" +} + +data "scalr_provider_configurations" "google" { + provider_name = "google" +} diff --git a/examples/data-sources/scalr_role/data-source.tf b/examples/data-sources/scalr_role/data-source.tf new file mode 100644 index 00000000..33ffddfd --- /dev/null +++ b/examples/data-sources/scalr_role/data-source.tf @@ -0,0 +1,17 @@ +# To retrieve a custom role, an account id and role id (or name) are required: + +data "scalr_role" "example1" { + id = "role-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_role" "example2" { + name = "WorkspaceAdmin" + account_id = "acc-xxxxxxxxxx" +} + +# To retrieve system-managed roles an account id has to be omitted: + +data "scalr_role" "example3" { + name = "user" +} diff --git a/examples/data-sources/scalr_service_account/data-source.tf b/examples/data-sources/scalr_service_account/data-source.tf new file mode 100644 index 00000000..29c4d2cf --- /dev/null +++ b/examples/data-sources/scalr_service_account/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_service_account" "example1" { + id = "sa-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_service_account" "example2" { + email = "name@account.scalr.io" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_tag/data-source.tf b/examples/data-sources/scalr_tag/data-source.tf new file mode 100644 index 00000000..3fb15e0f --- /dev/null +++ b/examples/data-sources/scalr_tag/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_tag" "example1" { + id = "tag-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_tag" "example2" { + name = "tag-name" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_variable/data-source.tf b/examples/data-sources/scalr_variable/data-source.tf new file mode 100644 index 00000000..df7d0675 --- /dev/null +++ b/examples/data-sources/scalr_variable/data-source.tf @@ -0,0 +1,12 @@ +data "scalr_variable" "example1" { + id = "var-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_variable" "example2" { + key = "key" + category = "terraform" + account_id = "acc-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" + workspace_id = "ws-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_variables/data-source.tf b/examples/data-sources/scalr_variables/data-source.tf new file mode 100644 index 00000000..3ccd207e --- /dev/null +++ b/examples/data-sources/scalr_variables/data-source.tf @@ -0,0 +1,7 @@ +data "scalr_variables" "example" { + keys = ["key1", "key2", "key3"] + category = "terraform" # or shell + account_id = "acc-xxxxxxxxxx" + envrironment_ids = ["env-xxxxxxxxxx", "null"] + workspace_ids = ["ws-xxxxxxxxxx", "null"] +} diff --git a/examples/data-sources/scalr_vcs_provider/data-source.tf b/examples/data-sources/scalr_vcs_provider/data-source.tf new file mode 100644 index 00000000..aed3b16e --- /dev/null +++ b/examples/data-sources/scalr_vcs_provider/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_vcs_provider" "example1" { + id = "vcs-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_vcs_provider" "example2" { + name = "example" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_webhook/data-source.tf b/examples/data-sources/scalr_webhook/data-source.tf new file mode 100644 index 00000000..195d58ff --- /dev/null +++ b/examples/data-sources/scalr_webhook/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_webhook" "example1" { + id = "wh-xxxxxxxxxx" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_webhook" "example2" { + name = "webhook_name" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_workspace/data-source.tf b/examples/data-sources/scalr_workspace/data-source.tf new file mode 100644 index 00000000..db88cd2e --- /dev/null +++ b/examples/data-sources/scalr_workspace/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_workspace" "example1" { + id = "ws-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspace" "example2" { + name = "my-workspace-name" + environment_id = "env-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_workspace_ids/data-source.tf b/examples/data-sources/scalr_workspace_ids/data-source.tf new file mode 100644 index 00000000..512c4ab2 --- /dev/null +++ b/examples/data-sources/scalr_workspace_ids/data-source.tf @@ -0,0 +1,9 @@ +data "scalr_workspace_ids" "app-frontend" { + names = ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"] + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspace_ids" "all" { + names = ["*"] + environment_id = "env-xxxxxxxxxx" +} diff --git a/examples/data-sources/scalr_workspaces/data-source.tf b/examples/data-sources/scalr_workspaces/data-source.tf new file mode 100644 index 00000000..3e5552a3 --- /dev/null +++ b/examples/data-sources/scalr_workspaces/data-source.tf @@ -0,0 +1,16 @@ +data "scalr_workspaces" "exact-names" { + name = "in:production,development" +} + +data "scalr_workspaces" "app-frontend" { + name = "like:app-frontend-" + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspaces" "tagged" { + tag_ids = ["tag-xxxxxxxxxx", "tag-xxxxxxxxxx"] +} + +data "scalr_workspaces" "all" { + environment_id = "env-xxxxxxxxxx" +} diff --git a/examples/provider/auth.tf b/examples/provider/auth.tf new file mode 100644 index 00000000..7033dd34 --- /dev/null +++ b/examples/provider/auth.tf @@ -0,0 +1,4 @@ +provider "scalr" { + hostname = var.hostname + token = var.api_token +} diff --git a/examples/provider/usage.tf b/examples/provider/usage.tf new file mode 100644 index 00000000..9e1f8455 --- /dev/null +++ b/examples/provider/usage.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + scalr = { + source = "registry.scalr.io/scalr/scalr" + version = "~> 1.0" + } + } +} diff --git a/examples/resources/scalr_access_policy/import.sh b/examples/resources/scalr_access_policy/import.sh new file mode 100644 index 00000000..3a9caccc --- /dev/null +++ b/examples/resources/scalr_access_policy/import.sh @@ -0,0 +1 @@ +terraform import scalr_access_policy.example ap-xxxxxxxxxx diff --git a/examples/resources/scalr_access_policy/resource.tf b/examples/resources/scalr_access_policy/resource.tf new file mode 100644 index 00000000..41358595 --- /dev/null +++ b/examples/resources/scalr_access_policy/resource.tf @@ -0,0 +1,24 @@ +resource "scalr_role" "reader" { + name = "Reader" + account_id = "acc-xxxxxxxxxx" + description = "Read access to all resources." + + permissions = [ + "*:read", + ] +} + +resource "scalr_access_policy" "team_read_all_on_acc_scope" { + subject { + type = "team" + id = "team-xxxxxxxxxx" + } + scope { + type = "account" + id = "acc-xxxxxxxxxx" + } + + role_ids = [ + scalr_role.reader.id + ] +} diff --git a/examples/resources/scalr_account_allowed_ips/import.sh b/examples/resources/scalr_account_allowed_ips/import.sh new file mode 100644 index 00000000..97a0366b --- /dev/null +++ b/examples/resources/scalr_account_allowed_ips/import.sh @@ -0,0 +1 @@ +terraform import scalr_account_allowed_ips.example acc-xxxxxxxxxx diff --git a/examples/resources/scalr_account_allowed_ips/resource.tf b/examples/resources/scalr_account_allowed_ips/resource.tf new file mode 100644 index 00000000..264cb65e --- /dev/null +++ b/examples/resources/scalr_account_allowed_ips/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_account_allowed_ips" "default" { + account_id = "acc-xxxxxxxxxx" + allowed_ips = ["127.0.0.1", "192.168.0.0/24"] +} diff --git a/examples/resources/scalr_agent_pool/import.sh b/examples/resources/scalr_agent_pool/import.sh new file mode 100644 index 00000000..4cf7bdc1 --- /dev/null +++ b/examples/resources/scalr_agent_pool/import.sh @@ -0,0 +1 @@ +terraform import scalr_agent_pool.example apool-xxxxxxxxxx diff --git a/examples/resources/scalr_agent_pool/resource.tf b/examples/resources/scalr_agent_pool/resource.tf new file mode 100644 index 00000000..7b59d9ce --- /dev/null +++ b/examples/resources/scalr_agent_pool/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_agent_pool" "default" { + name = "default-pool" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_agent_pool_token/resource.tf b/examples/resources/scalr_agent_pool_token/resource.tf new file mode 100644 index 00000000..09be9b3b --- /dev/null +++ b/examples/resources/scalr_agent_pool_token/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_agent_pool_token" "default" { + description = "Some description" + agent_pool_id = "apool-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_endpoint/import.sh b/examples/resources/scalr_endpoint/import.sh new file mode 100644 index 00000000..39464312 --- /dev/null +++ b/examples/resources/scalr_endpoint/import.sh @@ -0,0 +1 @@ +terraform import scalr_endpoint.example ep-xxxxxxxxxx diff --git a/examples/resources/scalr_endpoint/resource.tf b/examples/resources/scalr_endpoint/resource.tf new file mode 100644 index 00000000..382a64bc --- /dev/null +++ b/examples/resources/scalr_endpoint/resource.tf @@ -0,0 +1,8 @@ +resource "scalr_endpoint" "example" { + name = "my-endpoint-name" + secret_key = "my-secret-key" + timeout = 15 + max_attempts = 3 + url = "https://my-endpoint.url" + environment_id = "env-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_endpoint/secret-key.tf b/examples/resources/scalr_endpoint/secret-key.tf new file mode 100644 index 00000000..ce386d3b --- /dev/null +++ b/examples/resources/scalr_endpoint/secret-key.tf @@ -0,0 +1,9 @@ +resource "random_string" "r" { + length = 16 +} + +resource "scalr_endpoint" "example" { + # ... + secret_key = random_string.r.result + # ... +} diff --git a/examples/resources/scalr_environment/import.sh b/examples/resources/scalr_environment/import.sh new file mode 100644 index 00000000..1786940b --- /dev/null +++ b/examples/resources/scalr_environment/import.sh @@ -0,0 +1 @@ +terraform import scalr_environment.example env-xxxxxxxxxx diff --git a/examples/resources/scalr_environment/resource.tf b/examples/resources/scalr_environment/resource.tf new file mode 100644 index 00000000..fea13878 --- /dev/null +++ b/examples/resources/scalr_environment/resource.tf @@ -0,0 +1,7 @@ +resource "scalr_environment" "test" { + name = "test-env" + account_id = "acc-xxxxxxxxxx" + cost_estimation_enabled = true + policy_groups = ["pgrp-xxxxxxxxxx", "pgrp-yyyyyyyyyy"] + default_provider_configurations = ["pcfg-xxxxxxxxxx", "pcfg-yyyyyyyyyy"] +} diff --git a/examples/resources/scalr_iam_team/import.sh b/examples/resources/scalr_iam_team/import.sh new file mode 100644 index 00000000..78ea1b4c --- /dev/null +++ b/examples/resources/scalr_iam_team/import.sh @@ -0,0 +1 @@ +terraform import scalr_iam_team.example team-xxxxxxxxxx diff --git a/examples/resources/scalr_iam_team/resource.tf b/examples/resources/scalr_iam_team/resource.tf new file mode 100644 index 00000000..06750632 --- /dev/null +++ b/examples/resources/scalr_iam_team/resource.tf @@ -0,0 +1,7 @@ +resource "scalr_iam_team" "example" { + name = "dev" + description = "Developers" + account_id = "acc-xxxxxxxxxx" + + users = ["user-xxxxxxxxxx", "user-yyyyyyyyyy"] +} diff --git a/examples/resources/scalr_module/import.sh b/examples/resources/scalr_module/import.sh new file mode 100644 index 00000000..96df7229 --- /dev/null +++ b/examples/resources/scalr_module/import.sh @@ -0,0 +1 @@ +terraform import scalr_module.example mod-xxxxxxxxxx diff --git a/examples/resources/scalr_module/resource.tf b/examples/resources/scalr_module/resource.tf new file mode 100644 index 00000000..5eb797f0 --- /dev/null +++ b/examples/resources/scalr_module/resource.tf @@ -0,0 +1,10 @@ +resource "scalr_module" "example" { + account_id = "acc-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" + vcs_provider_id = "vcs-xxxxxxxxxx" + vcs_repo { + identifier = "org/repo" + path = "example/terraform--" + tag_prefix = "aws/" + } +} diff --git a/examples/resources/scalr_policy_group/import.sh b/examples/resources/scalr_policy_group/import.sh new file mode 100644 index 00000000..db1eee34 --- /dev/null +++ b/examples/resources/scalr_policy_group/import.sh @@ -0,0 +1 @@ +terraform import scalr_policy_group.example pgrp-xxxxxxxxxx diff --git a/examples/resources/scalr_policy_group/resource.tf b/examples/resources/scalr_policy_group/resource.tf new file mode 100644 index 00000000..4b35922e --- /dev/null +++ b/examples/resources/scalr_policy_group/resource.tf @@ -0,0 +1,11 @@ +resource "scalr_policy_group" "example" { + name = "instance_types" + opa_version = "0.29.4" + account_id = "acc-xxxxxxxxxx" + vcs_provider_id = "vcs-xxxxxxxxxx" + vcs_repo { + identifier = "org/repo" + path = "policies/instance" + branch = "dev" + } +} diff --git a/examples/resources/scalr_policy_group_linkage/import.sh b/examples/resources/scalr_policy_group_linkage/import.sh new file mode 100644 index 00000000..c0cac4e0 --- /dev/null +++ b/examples/resources/scalr_policy_group_linkage/import.sh @@ -0,0 +1 @@ +terraform import scalr_policy_group_linkage.example pgrp-xxxxxxxxxx/env-xxxxxxxxxx diff --git a/examples/resources/scalr_policy_group_linkage/resource.tf b/examples/resources/scalr_policy_group_linkage/resource.tf new file mode 100644 index 00000000..a405457c --- /dev/null +++ b/examples/resources/scalr_policy_group_linkage/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_policy_group_linkage" "example" { + policy_group_id = "pgrp-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_provider_configuration/aws-oidc.tf b/examples/resources/scalr_provider_configuration/aws-oidc.tf new file mode 100644 index 00000000..4c10f0c3 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/aws-oidc.tf @@ -0,0 +1,11 @@ +resource "scalr_provider_configuration" "oidc" { + name = "oidc_dev_us_east_1" + account_id = "acc-xxxxxxxxxx" + export_shell_variables = false + environments = ["*"] + aws { + credentials_type = "oidc" + role_arn = "arn:aws:iam::123456789012:role/scalr-oidc-role" + audience = "aws.scalr-run-workload" + } +} diff --git a/examples/resources/scalr_provider_configuration/aws.tf b/examples/resources/scalr_provider_configuration/aws.tf new file mode 100644 index 00000000..88d5bb60 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/aws.tf @@ -0,0 +1,12 @@ +resource "scalr_provider_configuration" "aws" { + name = "aws_dev_us_east_1" + account_id = "acc-xxxxxxxxxx" + export_shell_variables = false + environments = ["env-xxxxxxxxxx"] + aws { + account_type = "regular" + credentials_type = "access_keys" + secret_key = "my-secret-key" + access_key = "my-access-key" + } +} diff --git a/examples/resources/scalr_provider_configuration/azurerm-oidc.tf b/examples/resources/scalr_provider_configuration/azurerm-oidc.tf new file mode 100644 index 00000000..5c6b75a0 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/azurerm-oidc.tf @@ -0,0 +1,11 @@ +resource "scalr_provider_configuration" "azurerm_oidc" { + name = "azurerm" + account_id = "acc-xxxxxxxxxx" + azurerm { + auth_type = "oidc" + audience = "scalr-workload-identity" + client_id = "my-client-id" + tenant_id = "my-tenant-id" + subscription_id = "my-subscription-id" + } +} diff --git a/examples/resources/scalr_provider_configuration/azurerm.tf b/examples/resources/scalr_provider_configuration/azurerm.tf new file mode 100644 index 00000000..64af471b --- /dev/null +++ b/examples/resources/scalr_provider_configuration/azurerm.tf @@ -0,0 +1,10 @@ +resource "scalr_provider_configuration" "azurerm" { + name = "azurerm" + account_id = "acc-xxxxxxxxxx" + azurerm { + client_id = "my-client-id" + client_secret = "my-client-secret" + subscription_id = "my-subscription-id" + tenant_id = "my-tenant-id" + } +} diff --git a/examples/resources/scalr_provider_configuration/custom.tf b/examples/resources/scalr_provider_configuration/custom.tf new file mode 100644 index 00000000..e9727026 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/custom.tf @@ -0,0 +1,21 @@ +resource "scalr_provider_configuration" "kubernetes" { + name = "k8s" + account_id = "acc-xxxxxxxxxx" + custom { + provider_name = "kubernetes" + argument { + name = "host" + value = "my-host" + description = "The hostname (in form of URI) of the Kubernetes API." + } + argument { + name = "username" + value = "my-username" + } + argument { + name = "password" + value = "my-password" + sensitive = true + } + } +} diff --git a/examples/resources/scalr_provider_configuration/google-oidc.tf b/examples/resources/scalr_provider_configuration/google-oidc.tf new file mode 100644 index 00000000..3bd0af40 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/google-oidc.tf @@ -0,0 +1,10 @@ +resource "scalr_provider_configuration" "google" { + name = "google_main" + account_id = "acc-xxxxxxxxxx" + google { + auth_type = "oidc" + project = "my-project" + service_account_email = "user@example.com" + workload_provider_name = "projects/123/locations/global/workloadIdentityPools/pool-name/providers/provider-name" + } +} diff --git a/examples/resources/scalr_provider_configuration/google.tf b/examples/resources/scalr_provider_configuration/google.tf new file mode 100644 index 00000000..e35e2d2c --- /dev/null +++ b/examples/resources/scalr_provider_configuration/google.tf @@ -0,0 +1,8 @@ +resource "scalr_provider_configuration" "google" { + name = "google_main" + account_id = "acc-xxxxxxxxxx" + google { + project = "my-project" + credentials = "my-credentials" + } +} diff --git a/examples/resources/scalr_provider_configuration/import.sh b/examples/resources/scalr_provider_configuration/import.sh new file mode 100644 index 00000000..cb9bc560 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/import.sh @@ -0,0 +1 @@ +terraform import scalr_provider_configuration.example pcfg-xxxxxxxxxx diff --git a/examples/resources/scalr_provider_configuration/scalr.tf b/examples/resources/scalr_provider_configuration/scalr.tf new file mode 100644 index 00000000..4826ae01 --- /dev/null +++ b/examples/resources/scalr_provider_configuration/scalr.tf @@ -0,0 +1,9 @@ +resource "scalr_provider_configuration" "scalr" { + name = "scalr" + account_id = "acc-xxxxxxxxxx" + environments = ["*"] + scalr { + hostname = "scalr.host.example.com" + token = "my-scalr-token" + } +} diff --git a/examples/resources/scalr_provider_configuration_default/import.sh b/examples/resources/scalr_provider_configuration_default/import.sh new file mode 100644 index 00000000..5314e21f --- /dev/null +++ b/examples/resources/scalr_provider_configuration_default/import.sh @@ -0,0 +1 @@ +terraform import scalr_provider_configuration_default.example env-xxxxxxxxxx/pcfg-xxxxxxxxxx diff --git a/examples/resources/scalr_provider_configuration_default/resource.tf b/examples/resources/scalr_provider_configuration_default/resource.tf new file mode 100644 index 00000000..e46ef59b --- /dev/null +++ b/examples/resources/scalr_provider_configuration_default/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_provider_configuration_default" "example" { + environment_id = "env-xxxxxxxxxx" + provider_configuration_id = "pcfg-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_role/import.sh b/examples/resources/scalr_role/import.sh new file mode 100644 index 00000000..e3b6f2f2 --- /dev/null +++ b/examples/resources/scalr_role/import.sh @@ -0,0 +1 @@ +terraform import scalr_role.example role-xxxxxxxxxx diff --git a/examples/resources/scalr_role/resource.tf b/examples/resources/scalr_role/resource.tf new file mode 100644 index 00000000..204bb47e --- /dev/null +++ b/examples/resources/scalr_role/resource.tf @@ -0,0 +1,11 @@ +resource "scalr_role" "writer" { + name = "Writer" + account_id = "acc-xxxxxxxxxx" + description = "Write access to all resources." + + permissions = [ + "*:update", + "*:delete", + "*:create" + ] +} diff --git a/examples/resources/scalr_run_trigger/import.sh b/examples/resources/scalr_run_trigger/import.sh new file mode 100644 index 00000000..9c9eb75a --- /dev/null +++ b/examples/resources/scalr_run_trigger/import.sh @@ -0,0 +1 @@ +terraform import scalr_run_trigger.example rt-xxxxxxxxxx diff --git a/examples/resources/scalr_run_trigger/resource.tf b/examples/resources/scalr_run_trigger/resource.tf new file mode 100644 index 00000000..3aba51f2 --- /dev/null +++ b/examples/resources/scalr_run_trigger/resource.tf @@ -0,0 +1,15 @@ +data "scalr_workspace" "downstream" { + name = "downstream" + environment_id = "env-xxxxxxxxxx" +} + +data "scalr_workspace" "upstream" { + name = "upstream" + environment_id = "env-xxxxxxxxxx" +} + +resource "scalr_run_trigger" "set_downstream" { + # run automatically triggered in this workspace once the run in the upstream workspace is applied + downstream_id = data.scalr_workspace.downstream.id + upstream_id = data.scalr_workspace.upstream.id +} diff --git a/examples/resources/scalr_service_account/import.sh b/examples/resources/scalr_service_account/import.sh new file mode 100644 index 00000000..93d78eba --- /dev/null +++ b/examples/resources/scalr_service_account/import.sh @@ -0,0 +1 @@ +terraform import scalr_service_account.example sa-xxxxxxxxxx diff --git a/examples/resources/scalr_service_account/resource.tf b/examples/resources/scalr_service_account/resource.tf new file mode 100644 index 00000000..8e964be1 --- /dev/null +++ b/examples/resources/scalr_service_account/resource.tf @@ -0,0 +1,6 @@ +resource "scalr_service_account" "example" { + name = "sa-name" + description = "Lorem ipsum" + status = "Active" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_service_account_token/resource.tf b/examples/resources/scalr_service_account_token/resource.tf new file mode 100644 index 00000000..9e6c322b --- /dev/null +++ b/examples/resources/scalr_service_account_token/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_service_account_token" "default" { + service_account_id = "sa-xxxxxxxxxx" + description = "Some description" +} diff --git a/examples/resources/scalr_slack_integration/import.sh b/examples/resources/scalr_slack_integration/import.sh new file mode 100644 index 00000000..9f1a4327 --- /dev/null +++ b/examples/resources/scalr_slack_integration/import.sh @@ -0,0 +1 @@ +terraform import scalr_slack_integration.example in-xxxxxxxxxx diff --git a/examples/resources/scalr_slack_integration/resource.tf b/examples/resources/scalr_slack_integration/resource.tf new file mode 100644 index 00000000..85dad969 --- /dev/null +++ b/examples/resources/scalr_slack_integration/resource.tf @@ -0,0 +1,8 @@ +resource "scalr_slack_integration" "test" { + name = "my-channel" + account_id = "acc-xxxxxxxxxx" + events = ["run_approval_required", "run_success", "run_errored"] + channel_id = "xxxxxxxxxx" # Can be found in slack UI (channel settings/info popup) + environments = ["env-xxxxxxxxxx"] + workspaces = ["ws-xxxxxxxxxx", "ws-yyyyyyyyyy"] +} diff --git a/examples/resources/scalr_tag/import.sh b/examples/resources/scalr_tag/import.sh new file mode 100644 index 00000000..9bd0e656 --- /dev/null +++ b/examples/resources/scalr_tag/import.sh @@ -0,0 +1 @@ +terraform import scalr_tag.example tag-xxxxxxxxxx diff --git a/examples/resources/scalr_tag/resource.tf b/examples/resources/scalr_tag/resource.tf new file mode 100644 index 00000000..3038f869 --- /dev/null +++ b/examples/resources/scalr_tag/resource.tf @@ -0,0 +1,4 @@ +resource "scalr_tag" "example" { + name = "tag-name" + account_id = "acc-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_variable/import.sh b/examples/resources/scalr_variable/import.sh new file mode 100644 index 00000000..9a856d4e --- /dev/null +++ b/examples/resources/scalr_variable/import.sh @@ -0,0 +1 @@ +terraform import scalr_variable.example var-xxxxxxxxxx diff --git a/examples/resources/scalr_variable/resource.tf b/examples/resources/scalr_variable/resource.tf new file mode 100644 index 00000000..5bd29fd8 --- /dev/null +++ b/examples/resources/scalr_variable/resource.tf @@ -0,0 +1,15 @@ +resource "scalr_variable" "example1" { + key = "my_key_name" + value = "my_value_name" + category = "terraform" + description = "variable description" + workspace_id = "ws-xxxxxxxxxx" +} + +resource "scalr_variable" "example2" { + key = "xyz" + value = jsonencode(["foo", "bar"]) + hcl = true + category = "terraform" + workspace_id = "ws-yyyyyyyyyy" +} diff --git a/examples/resources/scalr_vcs_provider/import.sh b/examples/resources/scalr_vcs_provider/import.sh new file mode 100644 index 00000000..2297f18e --- /dev/null +++ b/examples/resources/scalr_vcs_provider/import.sh @@ -0,0 +1 @@ +terraform import scalr_vcs_provider.example vcs-xxxxxxxxxx diff --git a/examples/resources/scalr_vcs_provider/resource.tf b/examples/resources/scalr_vcs_provider/resource.tf new file mode 100644 index 00000000..aaf2d5fe --- /dev/null +++ b/examples/resources/scalr_vcs_provider/resource.tf @@ -0,0 +1,6 @@ +resource "scalr_vcs_provider" "example" { + name = "example-github" + account_id = "acc-xxxxxxxxxx" + vcs_type = "github" + token = "token" +} diff --git a/examples/resources/scalr_webhook/import.sh b/examples/resources/scalr_webhook/import.sh new file mode 100644 index 00000000..93f4a7a6 --- /dev/null +++ b/examples/resources/scalr_webhook/import.sh @@ -0,0 +1 @@ +terraform import scalr_webhook.example wh-xxxxxxxxxx diff --git a/examples/resources/scalr_webhook/resource.tf b/examples/resources/scalr_webhook/resource.tf new file mode 100644 index 00000000..9d5863cf --- /dev/null +++ b/examples/resources/scalr_webhook/resource.tf @@ -0,0 +1,28 @@ +resource "scalr_webhook" "example1" { + name = "my-webhook-1" + enabled = true + url = "https://my-endpoint.url" + secret_key = "my-secret-key" + timeout = 15 + max_attempts = 3 + events = ["run:completed", "run:errored"] + environments = ["env-xxxxxxxxxx"] + header { + name = "header1" + value = "value1" + } + header { + name = "header2" + value = "value2" + } +} + +# Old-style webhook resource (deprecated): +resource "scalr_webhook" "example2" { + name = "my-webhook-2" + enabled = true + endpoint_id = "ep-xxxxxxxxxx" + events = ["run:completed", "run:errored"] + workspace_id = "ws-xxxxxxxxxx" + environment_id = "env-xxxxxxxxxx" +} diff --git a/examples/resources/scalr_workspace/cli.tf b/examples/resources/scalr_workspace/cli.tf new file mode 100644 index 00000000..e42dcfa4 --- /dev/null +++ b/examples/resources/scalr_workspace/cli.tf @@ -0,0 +1,10 @@ +data "scalr_environment" "example" { + name = "env-name" + account_id = "acc-xxxxxxxxxx" +} + +resource "scalr_workspace" "example" { + name = "my-workspace-name" + environment_id = data.scalr_environment.example.id + working_directory = "example/path" +} diff --git a/examples/resources/scalr_workspace/import.sh b/examples/resources/scalr_workspace/import.sh new file mode 100644 index 00000000..67bca9a9 --- /dev/null +++ b/examples/resources/scalr_workspace/import.sh @@ -0,0 +1 @@ +terraform import scalr_workspace.example ws-xxxxxxxxxx diff --git a/examples/resources/scalr_workspace/module.tf b/examples/resources/scalr_workspace/module.tf new file mode 100644 index 00000000..ebe457f5 --- /dev/null +++ b/examples/resources/scalr_workspace/module.tf @@ -0,0 +1,24 @@ +data "scalr_environment" "example" { + name = "env-name" + account_id = "acc-xxxxxxxxxx" +} + +locals { + modules = { + "${data.scalr_environment.example.id}" : "module-name/provider", # environment-level module will be selected + "${data.scalr_environment.example.account_id}" : "module-name/provider", # account-level module will be selected + } +} + +data "scalr_module_version" "example" { + for_each = local.modules + source = "${each.key}/${each.value}" +} + +resource "scalr_workspace" "example" { + for_each = data.scalr_module_version.example + environment_id = data.scalr_environment.example.id + + name = replace(each.value.source, "/", "-") + module_version_id = each.value.id +} diff --git a/examples/resources/scalr_workspace/tags.tf b/examples/resources/scalr_workspace/tags.tf new file mode 100644 index 00000000..d758a141 --- /dev/null +++ b/examples/resources/scalr_workspace/tags.tf @@ -0,0 +1,19 @@ +resource "scalr_tag" "team-a" { + name = "TeamA" +} + +resource "scalr_tag" "team-b" { + name = "TeamB" +} + +resource "scalr_workspace" "example-a" { + environment_id = "env-xxxxxxxxxx" + name = "example-a" + tag_ids = [scalr_tag.team-a.id] +} + +resource "scalr_workspace" "example-b" { + environment_id = "env-xxxxxxxxxx" + name = "example-b" + tag_ids = [scalr_tag.team-b.id] +} diff --git a/examples/resources/scalr_workspace/vcs.tf b/examples/resources/scalr_workspace/vcs.tf new file mode 100644 index 00000000..6047cfa9 --- /dev/null +++ b/examples/resources/scalr_workspace/vcs.tf @@ -0,0 +1,32 @@ +data "scalr_vcs_provider" "example" { + name = "vcs-name" + account_id = "acc-xxxxxxxxxx" +} + +data "scalr_environment" "example" { + name = "env-name" + account_id = "acc-xxxxxxxxxx" +} + +resource "scalr_workspace" "example" { + name = "my-workspace-name" + environment_id = data.scalr_environment.example.id + vcs_provider_id = data.scalr_vcs_provider.example.id + + working_directory = "example/path" + + vcs_repo { + identifier = "org/repo" + branch = "dev" + trigger_prefixes = ["stage", "prod"] + } + + provider_configuration { + id = "pcfg-xxxxxxxxxx" + alias = "us_east1" + } + provider_configuration { + id = "pcfg-yyyyyyyyyy" + alias = "us_east2" + } +} diff --git a/examples/resources/scalr_workspace_run_schedule/import.sh b/examples/resources/scalr_workspace_run_schedule/import.sh new file mode 100644 index 00000000..3d7adcfc --- /dev/null +++ b/examples/resources/scalr_workspace_run_schedule/import.sh @@ -0,0 +1 @@ +terraform import scalr_workspace_run_schedule.example ws-xxxxxxxxxx diff --git a/examples/resources/scalr_workspace_run_schedule/resource.tf b/examples/resources/scalr_workspace_run_schedule/resource.tf new file mode 100644 index 00000000..7d40b5da --- /dev/null +++ b/examples/resources/scalr_workspace_run_schedule/resource.tf @@ -0,0 +1,5 @@ +resource "scalr_workspace_run_schedule" "example" { + workspace_id = "ws-xxxxxxxxxx" + apply_schedule = "30 3 5 3-5 2" + destroy_schedule = "30 4 5 3-5 2" +} diff --git a/go.mod b/go.mod index 81fe2f7e..33c9e8c5 100644 --- a/go.mod +++ b/go.mod @@ -3,21 +3,30 @@ module github.com/scalr/terraform-provider-scalr require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce + github.com/hashicorp/terraform-plugin-docs v0.16.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 github.com/scalr/go-scalr v0.0.0-20230724130629-32e739f11ab5 ) require ( + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/armon/go-radix v1.0.0 // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.13.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect @@ -26,37 +35,46 @@ require ( github.com/hashicorp/go-plugin v1.4.6 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/hashicorp/hc-install v0.4.0 // indirect + github.com/hashicorp/hc-install v0.5.2 // indirect github.com/hashicorp/hcl/v2 v2.15.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.17.3 // indirect - github.com/hashicorp/terraform-json v0.14.0 // indirect + github.com/hashicorp/terraform-exec v0.18.1 // indirect + github.com/hashicorp/terraform-json v0.17.1 // indirect github.com/hashicorp/terraform-plugin-go v0.14.1 // indirect github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect + github.com/posener/complete v1.2.3 // indirect + github.com/russross/blackfriday v1.6.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/cast v1.5.0 // indirect github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect - github.com/zclconf/go-cty v1.12.1 // indirect - golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect - golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + github.com/zclconf/go-cty v1.13.2 // indirect + golang.org/x/crypto v0.8.0 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect + golang.org/x/mod v0.11.0 // indirect + golang.org/x/net v0.9.0 // indirect golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect - golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/text v0.11.0 // indirect google.golang.org/appengine v1.6.6 // indirect google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect google.golang.org/grpc v1.50.1 // indirect google.golang.org/protobuf v1.28.1 // indirect ) -go 1.18 +go 1.19 diff --git a/go.sum b/go.sum index e225511e..21376966 100644 --- a/go.sum +++ b/go.sum @@ -33,16 +33,19 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= @@ -50,35 +53,36 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= +github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= +github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -137,10 +141,15 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -152,6 +161,7 @@ github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBM github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.4.6 h1:MDV3UrKQBM3du3G7MApDGvOsMYy3JQJ4exhSoKBAeVA= @@ -162,23 +172,24 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hc-install v0.4.0 h1:cZkRFr1WVa0Ty6x5fTvL1TuO1flul231rWkGH92oYYk= -github.com/hashicorp/hc-install v0.4.0/go.mod h1:5d155H8EC5ewegao9A4PUTMNPZaq+TbOzkJJZ4vrXeI= +github.com/hashicorp/hc-install v0.5.2 h1:SfwMFnEXVVirpwkDuSF5kymUOhrUxrTq3udEseZdOD0= +github.com/hashicorp/hc-install v0.5.2/go.mod h1:9QISwe6newMWIfEiXpzuu1k9HAGtQYgnSH8H9T8wmoI= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl/v2 v2.15.0 h1:CPDXO6+uORPjKflkWCCwoWc9uRp+zSIPcCQ+BrxV7m8= github.com/hashicorp/hcl/v2 v2.15.0/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.17.3 h1:MX14Kvnka/oWGmIkyuyvL6POx25ZmKrjlaclkx3eErU= -github.com/hashicorp/terraform-exec v0.17.3/go.mod h1:+NELG0EqQekJzhvikkeQsOAZpsw0cv/03rbeQJqscAI= -github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s= -github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= +github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= +github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= +github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= +github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= +github.com/hashicorp/terraform-plugin-docs v0.16.0 h1:UmxFr3AScl6Wged84jndJIfFccGyBZn52KtMNsS12dI= +github.com/hashicorp/terraform-plugin-docs v0.16.0/go.mod h1:M3ZrlKBJAbPMtNOPwHicGi1c+hZUh7/g0ifT/z7TVfA= github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H29tczAwrB0z9Zek= github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ= github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= @@ -191,69 +202,79 @@ github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKL github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/scalr/go-scalr v0.0.0-20230724130629-32e739f11ab5 h1:qG5f2IRp3zisp2TcnQlthkI4MKPXO53c8jsolHZtBNQ= github.com/scalr/go-scalr v0.0.0-20230724130629-32e739f11ab5/go.mod h1:p34SHb25YRvbgft7SUjSDYESeoQhWzAlxGXId/BbaSE= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= @@ -265,33 +286,28 @@ github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvC github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= -github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= +github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0= -golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -302,6 +318,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -322,6 +340,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -352,9 +372,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -371,7 +390,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -380,7 +398,6 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -399,25 +416,23 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM= -golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -548,18 +563,14 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go index f2b4cae6..241b42f9 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,15 @@ import ( "github.com/scalr/terraform-provider-scalr/scalr" ) +// Commands to prepare auto-generated documentation. +// - format terraform example snippets: +//go:generate terraform fmt -recursive examples +// - generate the /docs content: +//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --rendered-website-dir docs +// - inject proper 'order' Front Matter directives so pages are always sorted alphabetically: +//go:generate go run tools/page_order.go -dir=docs/data-sources +//go:generate go run tools/page_order.go -dir=docs/resources + const ( scalrProviderAddr = "registry.scalr.io/scalr/scalr" ) diff --git a/scalr/data_source_scalr_access_policy.go b/scalr/data_source_scalr_access_policy.go index d3565de7..bc16fd44 100644 --- a/scalr/data_source_scalr_access_policy.go +++ b/scalr/data_source_scalr_access_policy.go @@ -12,53 +12,63 @@ import ( func dataSourceScalrAccessPolicy() *schema.Resource { return &schema.Resource{ + Description: "This data source is used to retrieve details of a single access policy by id.", + ReadContext: dataSourceScalrAccessPolicyRead, Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Required: true, + Description: "The access policy ID.", + Type: schema.TypeString, + Required: true, }, "is_system": { Type: schema.TypeBool, Computed: true, }, "subject": { - Type: schema.TypeList, - Computed: true, + Description: "Defines the subject of the access policy.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Description: "The subject ID, `user-` for user, `team-` for team, `sa-` for service account.", + Type: schema.TypeString, + Computed: true, }, "type": { - Type: schema.TypeString, - Computed: true, + Description: "The subject type, is one of `user`, `team`, or `service_account`.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "scope": { - Type: schema.TypeList, - Computed: true, + Description: "Defines the scope where access policy is applied.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Description: "The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace.", + Type: schema.TypeString, + Computed: true, }, "type": { - Type: schema.TypeString, - Computed: true, + Description: "The scope identity type, is one of `account`, `environment`, or `workspace`.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "role_ids": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of the role IDs.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_agent_pool.go b/scalr/data_source_scalr_agent_pool.go index 703feb26..46d7e99f 100644 --- a/scalr/data_source_scalr_agent_pool.go +++ b/scalr/data_source_scalr_agent_pool.go @@ -13,9 +13,11 @@ import ( func dataSourceScalrAgentPool() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of an agent pool.", ReadContext: dataSourceScalrAgentPoolRead, Schema: map[string]*schema.Schema{ "id": { + Description: "ID of the agent pool.", Type: schema.TypeString, Optional: true, Computed: true, @@ -23,18 +25,21 @@ func dataSourceScalrAgentPool() *schema.Resource { AtLeastOneOf: []string{"name"}, }, "name": { + Description: "A name of the agent pool.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "vcs_enabled": { - Type: schema.TypeBool, - Optional: true, - Computed: true, + Description: "Indicates whether the VCS support is enabled for agents in the pool.", + Type: schema.TypeBool, + Optional: true, + Computed: true, }, "account_id": { + Description: "An identifier of the Scalr account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -42,14 +47,16 @@ func dataSourceScalrAgentPool() *schema.Resource { }, "environment_id": { - Type: schema.TypeString, - Optional: true, + Description: "An identifier of the Scalr environment.", + Type: schema.TypeString, + Optional: true, }, "workspace_ids": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of IDs of linked workspaces.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_current_account.go b/scalr/data_source_scalr_current_account.go index 91788cb5..604e8b0f 100644 --- a/scalr/data_source_scalr_current_account.go +++ b/scalr/data_source_scalr_current_account.go @@ -11,15 +11,20 @@ import ( func dataSourceScalrCurrentAccount() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of current account when using Scalr remote backend." + + "\n\nNo arguments are required. The data source returns details of the current account based on the" + + " `SCALR_ACCOUNT_ID` environment variable that is automatically exported in the Scalr remote backend.", ReadContext: dataSourceScalrCurrentAccountRead, Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Description: "The identifier of the account.", + Type: schema.TypeString, + Computed: true, }, "name": { - Type: schema.TypeString, - Computed: true, + Description: "The name of the account.", + Type: schema.TypeString, + Computed: true, }, }, } diff --git a/scalr/data_source_scalr_current_run.go b/scalr/data_source_scalr_current_run.go index 5543f4cd..31ae7a5c 100644 --- a/scalr/data_source_scalr_current_run.go +++ b/scalr/data_source_scalr_current_run.go @@ -19,56 +19,71 @@ const ( // https://iacp.docs.scalr.com/en/latest/working-with-iacp/opa.html#policy-checking-process func dataSourceScalrCurrentRun() *schema.Resource { return &schema.Resource{ + Description: "Allows you to get information about the current Terraform run" + + " when using a Scalr remote backend workspace, including VCS (Git) metadata." + + "\n\nNo arguments are required. The data source returns details of the current run based on the" + + " `SCALR_RUN_ID` shell variable that is automatically exported in the Scalr remoted backend.", ReadContext: dataSourceScalrCurrentRunRead, Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Description: "The ID of the run, in the format `run-`.", + Type: schema.TypeString, + Computed: true, }, "environment_id": { - Type: schema.TypeString, - Computed: true, + Description: "The ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Computed: true, }, "workspace_name": { - Type: schema.TypeString, - Computed: true, + Description: "Workspace name.", + Type: schema.TypeString, + Computed: true, }, "vcs": { - Type: schema.TypeList, - Computed: true, - Optional: true, + Description: "Contains details of the VCS configuration if the workspace is linked to a VCS repo.", + Type: schema.TypeList, + Computed: true, + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "repository_id": { - Type: schema.TypeString, - Computed: true, + Description: "ID of the VCS repo in the format `:org/:repo`.", + Type: schema.TypeString, + Computed: true, }, // TODO: add path "branch": { - Type: schema.TypeString, - Computed: true, + Description: "The linked VCS repo branch.", + Type: schema.TypeString, + Computed: true, }, "commit": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the last commit to the linked VCS repo.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "sha": { - Type: schema.TypeString, - Computed: true, + Description: "SHA of the last commit.", + Type: schema.TypeString, + Computed: true, }, "message": { - Type: schema.TypeString, - Computed: true, + Description: "Message for the last commit.", + Type: schema.TypeString, + Computed: true, }, "author": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the author of the last commit.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of the author in the VCS.", + Type: schema.TypeString, + Computed: true, }, // TODO: add email and name }, @@ -81,20 +96,24 @@ func dataSourceScalrCurrentRun() *schema.Resource { }, }, "source": { - Type: schema.TypeString, - Computed: true, + Description: "The source of the run (VCS, API, Manual).", + Type: schema.TypeString, + Computed: true, }, "message": { - Type: schema.TypeString, - Computed: true, + Description: "Message describing how the run was triggered.", + Type: schema.TypeString, + Computed: true, }, "is_destroy": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if this is a \"destroy\" run.", + Type: schema.TypeBool, + Computed: true, }, "is_dry": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if this is a dry run, i.e. triggered by a Pull Request (PR). No apply phase if this is true.", + Type: schema.TypeBool, + Computed: true, }, // TODO: add cost_estimate, credentials(?), created_by }, diff --git a/scalr/data_source_scalr_endpoint.go b/scalr/data_source_scalr_endpoint.go index d5994cd2..176f6c31 100644 --- a/scalr/data_source_scalr_endpoint.go +++ b/scalr/data_source_scalr_endpoint.go @@ -12,6 +12,7 @@ import ( func dataSourceScalrEndpoint() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a webhook endpoint.", DeprecationMessage: "Datasource `scalr_endpoint` is deprecated, the endpoint information" + " is included in the `scalr_webhook` resource.", @@ -20,6 +21,7 @@ func dataSourceScalrEndpoint() *schema.Resource { Schema: map[string]*schema.Schema{ "id": { + Description: "The endpoint ID, in the format `ep-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -28,6 +30,7 @@ func dataSourceScalrEndpoint() *schema.Resource { }, "name": { + Description: "Name of the endpoint.", Type: schema.TypeString, Optional: true, Computed: true, @@ -35,27 +38,32 @@ func dataSourceScalrEndpoint() *schema.Resource { }, "max_attempts": { - Type: schema.TypeInt, - Computed: true, + Description: "Max delivery attempts of the payload.", + Type: schema.TypeInt, + Computed: true, }, "secret_key": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Description: "Secret key to sign the webhook payload.", + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, "url": { - Type: schema.TypeString, - Computed: true, + Description: "Endpoint URL.", + Type: schema.TypeString, + Computed: true, }, "timeout": { - Type: schema.TypeInt, - Computed: true, + Description: "Endpoint timeout (in seconds).", + Type: schema.TypeInt, + Computed: true, }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -63,8 +71,9 @@ func dataSourceScalrEndpoint() *schema.Resource { }, "environment_id": { - Type: schema.TypeString, - Computed: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Computed: true, }, }, } diff --git a/scalr/data_source_scalr_environment.go b/scalr/data_source_scalr_environment.go index 6ac7a18c..1ceb7145 100644 --- a/scalr/data_source_scalr_environment.go +++ b/scalr/data_source_scalr_environment.go @@ -12,9 +12,11 @@ import ( func dataSourceScalrEnvironment() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a Scalr environment.", ReadContext: dataSourceEnvironmentRead, Schema: map[string]*schema.Schema{ "id": { + Description: "The environment ID, in the format `env-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -22,54 +24,64 @@ func dataSourceScalrEnvironment() *schema.Resource { AtLeastOneOf: []string{"name"}, }, "name": { + Description: "Name of the environment.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "cost_estimation_enabled": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if cost estimation is enabled for the environment.", + Type: schema.TypeBool, + Computed: true, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "The status of an environment.", + Type: schema.TypeString, + Computed: true, }, "created_by": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the user that created the environment.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of creator.", + Type: schema.TypeString, + Computed: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "Email address of creator.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "Full name of creator.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "account_id": { + Description: "ID of the environment account, in the format `acc-`", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "policy_groups": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of the environment policy-groups IDs, in the format `pgrp-`.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "tag_ids": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of tag IDs associated with the environment.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }} } diff --git a/scalr/data_source_scalr_environments.go b/scalr/data_source_scalr_environments.go index 82f200f0..e34a2f59 100644 --- a/scalr/data_source_scalr_environments.go +++ b/scalr/data_source_scalr_environments.go @@ -11,28 +11,33 @@ import ( func dataSourceScalrEnvironments() *schema.Resource { return &schema.Resource{ + Description: "Retrieves a list of environment ids by name or tags.", ReadContext: dataSourceScalrEnvironmentsRead, Schema: map[string]*schema.Schema{ "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "name": { - Type: schema.TypeString, - Optional: true, + Description: "The query used in a Scalr environment name filter.", + Type: schema.TypeString, + Optional: true, }, "tag_ids": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, + Description: "List of tag IDs associated with the environment.", + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Optional: true, }, "ids": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, + Description: "The list of environment IDs, in the format [`env-xxxxxxxxxxx`, `env-yyyyyyyyy`].", + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, }, }, } diff --git a/scalr/data_source_scalr_iam_team.go b/scalr/data_source_scalr_iam_team.go index ebb9fcc2..7823e823 100644 --- a/scalr/data_source_scalr_iam_team.go +++ b/scalr/data_source_scalr_iam_team.go @@ -10,10 +10,12 @@ import ( func dataSourceScalrIamTeam() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a Scalr team.", ReadContext: dataSourceScalrIamTeamRead, Schema: map[string]*schema.Schema{ "id": { + Description: "Identifier of the team.", Type: schema.TypeString, Optional: true, Computed: true, @@ -21,29 +23,34 @@ func dataSourceScalrIamTeam() *schema.Resource { AtLeastOneOf: []string{"name"}, }, "name": { + Description: "Name of the team.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "description": { - Type: schema.TypeString, - Computed: true, + Description: "A verbose description of the team.", + Type: schema.TypeString, + Computed: true, }, "account_id": { + Description: "The identifier of the Scalr account.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "identity_provider_id": { - Type: schema.TypeString, - Computed: true, + Description: "An identifier of an identity provider team is linked to, in the format `idp-`.", + Type: schema.TypeString, + Computed: true, }, "users": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of the user identifiers that belong to the team.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_iam_user.go b/scalr/data_source_scalr_iam_user.go index 436f2ea6..61c69509 100644 --- a/scalr/data_source_scalr_iam_user.go +++ b/scalr/data_source_scalr_iam_user.go @@ -12,10 +12,12 @@ import ( func dataSourceScalrIamUser() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a Scalr user.", ReadContext: dataSourceScalrIamUserRead, Schema: map[string]*schema.Schema{ "id": { + Description: "An identifier of a user.", Type: schema.TypeString, Optional: true, Computed: true, @@ -23,32 +25,38 @@ func dataSourceScalrIamUser() *schema.Resource { AtLeastOneOf: []string{"email"}, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "A system status of the user.", + Type: schema.TypeString, + Computed: true, }, "email": { + Description: "An email of a user.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "username": { - Type: schema.TypeString, - Computed: true, + Description: "A username of the user.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "A full name of the user.", + Type: schema.TypeString, + Computed: true, }, "identity_providers": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of the identity providers the user belongs to.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "teams": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of the team identifiers the user belongs to.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_module_version.go b/scalr/data_source_scalr_module_version.go index bdfb9894..bc5c7cd3 100644 --- a/scalr/data_source_scalr_module_version.go +++ b/scalr/data_source_scalr_module_version.go @@ -13,20 +13,24 @@ import ( func dataSourceModuleVersion() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the module version data by module source and semantic version.", ReadContext: dataSourceModuleVersionRead, Schema: map[string]*schema.Schema{ "source": { - Type: schema.TypeString, - Required: true, + Description: "The module source.", + Type: schema.TypeString, + Required: true, }, "version": { + Description: "The semantic version. If omitted, the latest module version is selected", Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "id": { - Type: schema.TypeString, - Computed: true, + Description: "The identifier of а module version. Example: `modver-xxxx`", + Type: schema.TypeString, + Computed: true, }, }} } diff --git a/scalr/data_source_scalr_policy_group.go b/scalr/data_source_scalr_policy_group.go index a594cde4..3047e85f 100644 --- a/scalr/data_source_scalr_policy_group.go +++ b/scalr/data_source_scalr_policy_group.go @@ -12,10 +12,12 @@ import ( func dataSourceScalrPolicyGroup() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a policy group.", ReadContext: dataSourceScalrPolicyGroupRead, Schema: map[string]*schema.Schema{ "id": { + Description: "The identifier of a policy group.", Type: schema.TypeString, Optional: true, Computed: true, @@ -23,77 +25,92 @@ func dataSourceScalrPolicyGroup() *schema.Resource { AtLeastOneOf: []string{"name"}, }, "name": { + Description: "The name of a policy group.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "A system status of the policy group.", + Type: schema.TypeString, + Computed: true, }, "error_message": { - Type: schema.TypeString, - Computed: true, + Description: "An error details if Scalr failed to process the policy group.", + Type: schema.TypeString, + Computed: true, }, "opa_version": { - Type: schema.TypeString, - Computed: true, + Description: "The version of the Open Policy Agent that the policy group is using.", + Type: schema.TypeString, + Computed: true, }, "vcs_repo": { - Type: schema.TypeList, - Computed: true, + Description: "Contains VCS-related meta-data for the policy group.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "identifier": { - Type: schema.TypeString, - Computed: true, + Description: "A reference to the VCS repository in the format `:org/:repo`, it stands for the organization and repository.", + Type: schema.TypeString, + Computed: true, }, "branch": { - Type: schema.TypeString, - Computed: true, + Description: "A branch of a repository the policy group is associated with.", + Type: schema.TypeString, + Computed: true, }, "path": { - Type: schema.TypeString, - Computed: true, + Description: "A subdirectory of a VCS repository where OPA policies are stored.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "account_id": { + Description: "The identifier of the Scalr account.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "vcs_provider_id": { - Type: schema.TypeString, - Computed: true, + Description: "The VCS provider identifier for the repository where the policy group resides. In the format `vcs-`.", + Type: schema.TypeString, + Computed: true, }, "policies": { - Type: schema.TypeList, - Computed: true, + Description: "A list of the OPA policies the policy group verifies each run.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Computed: true, + Description: "A name of a policy.", + Type: schema.TypeString, + Computed: true, }, "enabled": { - Type: schema.TypeBool, - Computed: true, + Description: "If set to `false`, the policy will not be verified on a run.", + Type: schema.TypeBool, + Computed: true, }, "enforced_level": { - Type: schema.TypeString, - Computed: true, + Description: "An enforcement level of a policy.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "environments": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of the environments the policy group is linked to.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_provider_configuration.go b/scalr/data_source_scalr_provider_configuration.go index b14f06de..52f0d50c 100644 --- a/scalr/data_source_scalr_provider_configuration.go +++ b/scalr/data_source_scalr_provider_configuration.go @@ -13,29 +13,34 @@ import ( func dataSourceScalrProviderConfiguration() *schema.Resource { return &schema.Resource{ + Description: "Retrieves information about a single provider configuration.", ReadContext: dataSourceScalrProviderConfigurationRead, Schema: map[string]*schema.Schema{ "id": { + Description: "The provider configuration ID, in the format `pcfg-xxxxxxxxxxx`.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "account_id": { + Description: "The identifier of the Scalr account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "name": { + Description: "The name of a Scalr provider configuration.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "provider_name": { - Type: schema.TypeString, - Optional: true, + Description: "The name of a Terraform provider.", + Type: schema.TypeString, + Optional: true, }, }, } diff --git a/scalr/data_source_scalr_provider_configurations.go b/scalr/data_source_scalr_provider_configurations.go index 002379ba..1dd4951b 100644 --- a/scalr/data_source_scalr_provider_configurations.go +++ b/scalr/data_source_scalr_provider_configurations.go @@ -12,26 +12,31 @@ import ( func dataSourceScalrProviderConfigurations() *schema.Resource { return &schema.Resource{ + Description: "Retrieves a list of provider configuration ids by name or type.", ReadContext: dataSourceScalrProviderConfigurationsRead, Schema: map[string]*schema.Schema{ "ids": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, + Description: "The list of provider configuration IDs, in the format [`pcfg-xxxxxxxxxxx`, `pcfg-yyyyyyyyy`].", + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, }, "account_id": { + Description: "The identifier of the Scalr account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "name": { - Type: schema.TypeString, - Optional: true, + Description: "The query used in a Scalr provider configuration name filter.", + Type: schema.TypeString, + Optional: true, }, "provider_name": { - Type: schema.TypeString, - Optional: true, + Description: "The name of a Terraform provider.", + Type: schema.TypeString, + Optional: true, }, }, } diff --git a/scalr/data_source_scalr_role.go b/scalr/data_source_scalr_role.go index 1b34a27c..28f175c2 100644 --- a/scalr/data_source_scalr_role.go +++ b/scalr/data_source_scalr_role.go @@ -12,10 +12,12 @@ import ( func dataSourceScalrRole() *schema.Resource { return &schema.Resource{ + Description: "This data source is used to retrieve details of a single role.", ReadContext: dataSourceScalrRoleRead, Schema: map[string]*schema.Schema{ "id": { + Description: "ID of the role.", Type: schema.TypeString, Optional: true, Computed: true, @@ -23,12 +25,14 @@ func dataSourceScalrRole() *schema.Resource { AtLeastOneOf: []string{"name"}, }, "name": { + Description: "Name of the role.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "account_id": { + Description: "ID of the account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -36,19 +40,22 @@ func dataSourceScalrRole() *schema.Resource { }, "is_system": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if the role can be edited.", + Type: schema.TypeBool, + Computed: true, }, "description": { - Type: schema.TypeString, - Computed: true, + Description: "Verbose description of the role.", + Type: schema.TypeString, + Computed: true, }, "permissions": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Array of permission names.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_service_account.go b/scalr/data_source_scalr_service_account.go index e2823e13..0feaa4a6 100644 --- a/scalr/data_source_scalr_service_account.go +++ b/scalr/data_source_scalr_service_account.go @@ -11,9 +11,11 @@ import ( func dataSourceScalrServiceAccount() *schema.Resource { return &schema.Resource{ + Description: "Retrieves information about a service account.", ReadContext: dataSourceScalrServiceAccountRead, Schema: map[string]*schema.Schema{ "id": { + Description: "The identifier of the service account in the format `sa-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -21,45 +23,54 @@ func dataSourceScalrServiceAccount() *schema.Resource { AtLeastOneOf: []string{"email"}, }, "name": { - Type: schema.TypeString, - Computed: true, + Description: "Name of the service account.", + Type: schema.TypeString, + Computed: true, }, "email": { + Description: "The email of the service account.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "description": { - Type: schema.TypeString, - Computed: true, + Description: "Description of the service account.", + Type: schema.TypeString, + Computed: true, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "The status of the service account.", + Type: schema.TypeString, + Computed: true, }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "created_by": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the user that created the service account.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of creator.", + Type: schema.TypeString, + Computed: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "Email address of creator.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "Full name of creator.", + Type: schema.TypeString, + Computed: true, }, }, }, diff --git a/scalr/data_source_scalr_tag.go b/scalr/data_source_scalr_tag.go index a75aa6b3..ee214c21 100644 --- a/scalr/data_source_scalr_tag.go +++ b/scalr/data_source_scalr_tag.go @@ -11,9 +11,11 @@ import ( func dataSourceScalrTag() *schema.Resource { return &schema.Resource{ + Description: "Retrieves information about a tag.", ReadContext: dataSourceScalrTagRead, Schema: map[string]*schema.Schema{ "id": { + Description: "The identifier of the tag in the format `tag-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -21,12 +23,14 @@ func dataSourceScalrTag() *schema.Resource { AtLeastOneOf: []string{"name"}, }, "name": { + Description: "The name of the tag.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "account_id": { + Description: "The ID of the Scalr account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, diff --git a/scalr/data_source_scalr_variable.go b/scalr/data_source_scalr_variable.go index dc3c71bb..c3f05b9c 100644 --- a/scalr/data_source_scalr_variable.go +++ b/scalr/data_source_scalr_variable.go @@ -10,9 +10,11 @@ import ( func dataSourceScalrVariable() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a variable.", ReadContext: dataSourceScalrVariableRead, Schema: map[string]*schema.Schema{ "id": { + Description: "ID of a Scalr variable.", Type: schema.TypeString, Optional: true, Computed: true, @@ -20,52 +22,62 @@ func dataSourceScalrVariable() *schema.Resource { AtLeastOneOf: []string{"key"}, }, "key": { + Description: "The name of a Scalr variable.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "category": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The category of a Scalr variable.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "account_id": { + Description: "ID of the account, in the format `acc-`", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "environment_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The identifier of the Scalr environment, in the format `env-`. Used to shrink the scope of the variable in case the variable name exists in multiple environments.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "workspace_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The identifier of the Scalr workspace, in the format `ws-`. Used to shrink the scope of the variable in case the variable name exists on multiple workspaces.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, // computed attributes "hcl": { - Type: schema.TypeBool, - Computed: true, + Description: "If the variable is configured as a string of HCL code.", + Type: schema.TypeBool, + Computed: true, }, "sensitive": { - Type: schema.TypeBool, - Computed: true, + Description: "If the variable is configured as sensitive.", + Type: schema.TypeBool, + Computed: true, }, "final": { - Type: schema.TypeBool, - Computed: true, + Description: "If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model.", + Type: schema.TypeBool, + Computed: true, }, "value": { - Type: schema.TypeString, - Computed: true, + Description: "Variable value.", + Type: schema.TypeString, + Computed: true, }, "description": { - Type: schema.TypeString, - Computed: true, + Description: "Variable verbose description, defaults to empty string.", + Type: schema.TypeString, + Computed: true, }, }} } diff --git a/scalr/data_source_scalr_variables.go b/scalr/data_source_scalr_variables.go index bfd0407d..e4dca014 100644 --- a/scalr/data_source_scalr_variables.go +++ b/scalr/data_source_scalr_variables.go @@ -12,56 +12,69 @@ import ( func dataSourceScalrVariables() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the list of variables by the given filters.", ReadContext: dataSourceScalrVariablesRead, Schema: map[string]*schema.Schema{ "variables": { - Type: schema.TypeSet, - Computed: true, + Description: "The list of Scalr variables with all attributes.", + Type: schema.TypeSet, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Required: true, + Description: "ID of the variable.", + Type: schema.TypeString, + Required: true, }, "category": { - Type: schema.TypeString, - Required: true, + Description: "Indicates if this is a Terraform or shell variable.", + Type: schema.TypeString, + Required: true, }, "hcl": { - Type: schema.TypeBool, - Required: true, + Description: "If the variable is configured as a string of HCL code.", + Type: schema.TypeBool, + Required: true, }, "key": { - Type: schema.TypeString, - Required: true, + Description: "Key of the variable.", + Type: schema.TypeString, + Required: true, }, "sensitive": { - Type: schema.TypeBool, - Required: true, + Description: "If the variable is configured as sensitive.", + Type: schema.TypeBool, + Required: true, }, "final": { - Type: schema.TypeBool, - Required: true, + Description: "If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model.", + Type: schema.TypeBool, + Required: true, }, "value": { - Type: schema.TypeString, - Optional: true, + Description: "Variable value if it is not sensitive.", + Type: schema.TypeString, + Optional: true, }, "description": { - Type: schema.TypeString, - Required: true, + Description: "Variable verbose description.", + Type: schema.TypeString, + Required: true, }, "workspace_id": { - Type: schema.TypeString, - Optional: true, + Description: "The workspace that owns the variable, specified as an ID, in the format `ws-`.", + Type: schema.TypeString, + Optional: true, }, "environment_id": { - Type: schema.TypeString, - Optional: true, + Description: "The environment that owns the variable, specified as an ID, in the format `env-`.", + Type: schema.TypeString, + Optional: true, }, "account_id": { - Type: schema.TypeString, - Optional: true, + Description: "The account that owns the variable, specified as an ID, in the format `acc-`.", + Type: schema.TypeString, + Optional: true, }, }, }, @@ -72,29 +85,34 @@ func dataSourceScalrVariables() *schema.Resource { }, }, "keys": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of keys to be used in the query used in a Scalr variable name filter.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "category": { - Type: schema.TypeString, - Optional: true, + Description: "The category of a Scalr variable.", + Type: schema.TypeString, + Optional: true, }, "environment_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of identifiers of the Scalr environments, in the format `env-`. Used to shrink the variable's scope in case the variable name exists in multiple environments.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "workspace_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of identifiers of the Scalr workspace, in the format `ws-`. Used to shrink the variable's scope in case the variable name exists on multiple workspaces.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }} } diff --git a/scalr/data_source_scalr_vcs_provider.go b/scalr/data_source_scalr_vcs_provider.go index 8ff20fdf..cb665934 100644 --- a/scalr/data_source_scalr_vcs_provider.go +++ b/scalr/data_source_scalr_vcs_provider.go @@ -10,48 +10,56 @@ import ( func dataSourceScalrVcsProvider() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a VCS provider.", ReadContext: dataSourceScalrVcsProviderRead, Schema: map[string]*schema.Schema{ "id": { + Description: "Identifier of the VCS provider.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "name": { + Description: "Name of the VCS provider.", Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "vcs_type": { - Type: schema.TypeString, - Computed: true, - Optional: true, + Description: "Type of the VCS provider. For example, `github`.", + Type: schema.TypeString, + Computed: true, + Optional: true, }, "url": { - Type: schema.TypeString, - Computed: true, - Optional: true, + Description: "The URL to the VCS provider installation.", + Type: schema.TypeString, + Computed: true, }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "environment_id": { - Type: schema.TypeString, - Optional: true, + Description: "ID of the environment the VCS provider has to be linked to, in the format `env-`.", + Type: schema.TypeString, + Optional: true, }, "agent_pool_id": { - Type: schema.TypeString, - Optional: true, + Description: "The id of the agent pool to connect Scalr to self-hosted VCS provider, in the format `apool-`.", + Type: schema.TypeString, + Optional: true, }, "environments": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of the identifiers of environments the VCS provider is linked to.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }} } diff --git a/scalr/data_source_scalr_webhook.go b/scalr/data_source_scalr_webhook.go index 34772ddd..792768cb 100644 --- a/scalr/data_source_scalr_webhook.go +++ b/scalr/data_source_scalr_webhook.go @@ -12,11 +12,13 @@ import ( func dataSourceScalrWebhook() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a webhook.", ReadContext: dataSourceScalrWebhookRead, Schema: map[string]*schema.Schema{ "id": { + Description: "The webhook ID, in the format `wh-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -25,6 +27,7 @@ func dataSourceScalrWebhook() *schema.Resource { }, "name": { + Description: "Name of the webhook.", Type: schema.TypeString, Optional: true, Computed: true, @@ -32,29 +35,34 @@ func dataSourceScalrWebhook() *schema.Resource { }, "enabled": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if the webhook is enabled.", + Type: schema.TypeBool, + Computed: true, }, "last_triggered_at": { - Type: schema.TypeString, - Computed: true, + Description: "Date/time when webhook was last triggered.", + Type: schema.TypeString, + Computed: true, }, "events": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of event IDs.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "endpoint_id": { - Type: schema.TypeString, - Computed: true, + Description: "ID of the endpoint, in the format `ep-`.", + Type: schema.TypeString, + Computed: true, Deprecated: "Attribute `endpoint_id` is deprecated, the endpoint information" + " is included in the `scalr_webhook` resource.", }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Computed: true, Optional: true, @@ -62,61 +70,71 @@ func dataSourceScalrWebhook() *schema.Resource { }, "environment_id": { - Type: schema.TypeString, - Computed: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Computed: true, Deprecated: "The attribute `environment_id` is deprecated. The webhook is created on the" + " account level and the environments to which it is exposed" + " are controlled by the `environments` attribute.", }, "workspace_id": { - Type: schema.TypeString, - Computed: true, - Deprecated: "The attribute `workspace_id` is deprecated.", + Description: "ID of the workspace, in the format `ws-`.", + Type: schema.TypeString, + Computed: true, + Deprecated: "The attribute `workspace_id` is deprecated.", }, "url": { - Type: schema.TypeString, - Computed: true, + Description: "Endpoint URL.", + Type: schema.TypeString, + Computed: true, }, "secret_key": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Description: "Secret key to sign the webhook payload.", + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, "timeout": { - Type: schema.TypeInt, - Computed: true, + Description: "Endpoint timeout (in seconds).", + Type: schema.TypeInt, + Computed: true, }, "max_attempts": { - Type: schema.TypeInt, - Computed: true, + Description: "Max delivery attempts of the payload.", + Type: schema.TypeInt, + Computed: true, }, "header": { - Type: schema.TypeSet, - Computed: true, + Description: "Additional headers to set in the webhook request.", + Type: schema.TypeSet, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Computed: true, + Description: "The name of the header.", + Type: schema.TypeString, + Computed: true, }, "value": { - Type: schema.TypeString, - Computed: true, + Description: "The value of the header.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "environments": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of environment identifiers that the webhook is shared to, or `[\"*\"]` if shared with all environments.", + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/data_source_scalr_workspace.go b/scalr/data_source_scalr_workspace.go index 33cf3523..56cbc0b3 100644 --- a/scalr/data_source_scalr_workspace.go +++ b/scalr/data_source_scalr_workspace.go @@ -13,10 +13,12 @@ import ( func dataSourceScalrWorkspace() *schema.Resource { return &schema.Resource{ + Description: "Retrieves the details of a single workspace.", ReadContext: dataSourceScalrWorkspaceRead, Schema: map[string]*schema.Schema{ "id": { + Description: "ID of the workspace.", Type: schema.TypeString, Optional: true, Computed: true, @@ -25,6 +27,7 @@ func dataSourceScalrWorkspace() *schema.Resource { }, "name": { + Description: "Name of the workspace.", Type: schema.TypeString, Optional: true, Computed: true, @@ -32,149 +35,182 @@ func dataSourceScalrWorkspace() *schema.Resource { }, "environment_id": { - Type: schema.TypeString, - Required: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Required: true, }, "vcs_provider_id": { - Type: schema.TypeString, - Optional: true, + Description: "The identifier of a VCS provider in the format `vcs-`.", + Type: schema.TypeString, + Computed: true, }, "module_version_id": { - Type: schema.TypeString, - Optional: true, + Description: "The identifier of a module version in the format `modver-`.", + Type: schema.TypeString, + Computed: true, }, "agent_pool_id": { - Type: schema.TypeString, - Optional: true, + Description: "The identifier of an agent pool in the format `apool-`.", + Type: schema.TypeString, + Computed: true, }, "auto_apply": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if `terraform apply` will be automatically run when `terraform plan` ends without error.", + Type: schema.TypeBool, + Computed: true, }, "force_latest_run": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if latest new run will be automatically raised in priority.", + Type: schema.TypeBool, + Computed: true, }, "deletion_protection_enabled": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean, indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed.", + Type: schema.TypeBool, + Computed: true, }, "operations": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if the workspace is being used for remote execution.", + Type: schema.TypeBool, + Computed: true, }, "execution_mode": { - Type: schema.TypeString, - Computed: true, + Description: "Execution mode of the workspace.", + Type: schema.TypeString, + Computed: true, }, "terraform_version": { - Type: schema.TypeString, - Computed: true, + Description: "The version of Terraform used for this workspace.", + Type: schema.TypeString, + Computed: true, }, "working_directory": { - Type: schema.TypeString, - Computed: true, + Description: "A relative path that Terraform will execute within.", + Type: schema.TypeString, + Computed: true, }, "has_resources": { - Type: schema.TypeBool, - Computed: true, + Description: "The presence of active terraform resources in the current state version.", + Type: schema.TypeBool, + Computed: true, }, "auto_queue_runs": { + Description: "Indicates if runs have to be queued automatically when a new configuration version is uploaded." + + "\n\n Supported values are `skip_first`, `always`, `never`:" + + "\n\n * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior." + + "\n * `always` - runs will be triggered automatically on every upload of the configuration version." + + "\n * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered.", Type: schema.TypeString, Computed: true, }, "hooks": { - Type: schema.TypeList, - Optional: true, + Description: "List of custom hooks in a workspace.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "pre_init": { - Type: schema.TypeString, - Optional: true, + Description: "Script or action configured to call before init phase.", + Type: schema.TypeString, + Computed: true, }, "pre_plan": { - Type: schema.TypeString, - Optional: true, + Description: "Script or action configured to call before plan phase.", + Type: schema.TypeString, + Computed: true, }, "post_plan": { - Type: schema.TypeString, - Optional: true, + Description: "Script or action configured to call after plan phase.", + Type: schema.TypeString, + Computed: true, }, "pre_apply": { - Type: schema.TypeString, - Optional: true, + Description: "Script or action configured to call before apply phase.", + Type: schema.TypeString, + Computed: true, }, "post_apply": { - Type: schema.TypeString, - Optional: true, + Description: "Script or action configured to call after apply phase.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "vcs_repo": { - Type: schema.TypeList, - Computed: true, + Description: "If a workspace is linked to a VCS repository this block shows the details, otherwise `{}`", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "identifier": { - Type: schema.TypeString, - Computed: true, + Description: "The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider.", + Type: schema.TypeString, + Computed: true, }, "path": { - Type: schema.TypeString, - Computed: true, + Description: "Path within the repo, if any.", + Type: schema.TypeString, + Computed: true, }, "dry_runs_enabled": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates the VCS-driven dry runs should run when the pull request to the configuration versions branch is created.", + Type: schema.TypeBool, + Computed: true, }, "ingress_submodules": { - Type: schema.TypeBool, - Computed: true, + Description: "Designates whether to clone git submodules of the VCS repository.", + Type: schema.TypeBool, + Computed: true, }, }, }, }, "tag_ids": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of tag IDs associated with the workspace.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "created_by": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the user that created the workspace.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of creator.", + Type: schema.TypeString, + Computed: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "Email address of creator.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "Full name of creator.", + Type: schema.TypeString, + Computed: true, }, }, }, diff --git a/scalr/data_source_scalr_workspace_ids.go b/scalr/data_source_scalr_workspace_ids.go index 655fdb4d..957cb34d 100644 --- a/scalr/data_source_scalr_workspace_ids.go +++ b/scalr/data_source_scalr_workspace_ids.go @@ -11,23 +11,27 @@ import ( func dataSourceScalrWorkspaceIDs() *schema.Resource { return &schema.Resource{ + Description: "Retrieves a map of workspace IDs based on the names provided. Wildcards are accepted.", ReadContext: dataSourceScalrWorkspaceIDsRead, Schema: map[string]*schema.Schema{ "names": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Required: true, + Description: "A list of names to search for. If a name does not exist, it will not throw an error, it will just not exist in the returned output. Use `[\"*\"]` to select all workspaces.", + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Required: true, }, "environment_id": { - Type: schema.TypeString, - Required: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Required: true, }, "ids": { - Type: schema.TypeMap, - Computed: true, + Description: "A map of workspace names and their opaque IDs, in the format `env_id/name`.", + Type: schema.TypeMap, + Computed: true, }, }, } diff --git a/scalr/data_source_scalr_workspaces.go b/scalr/data_source_scalr_workspaces.go index 98814840..a5888e8c 100644 --- a/scalr/data_source_scalr_workspaces.go +++ b/scalr/data_source_scalr_workspaces.go @@ -11,32 +11,38 @@ import ( func dataSourceScalrWorkspaces() *schema.Resource { return &schema.Resource{ + Description: "Retrieves a list of workspace ids by name or tags.", ReadContext: dataSourceScalrWorkspacesRead, Schema: map[string]*schema.Schema{ "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, DefaultFunc: scalrAccountIDDefaultFunc, }, "environment_id": { - Type: schema.TypeString, - Optional: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Optional: true, }, "name": { - Type: schema.TypeString, - Optional: true, + Description: "The query used in a Scalr workspace name filter.", + Type: schema.TypeString, + Optional: true, }, "tag_ids": { - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, + Description: "List of tag IDs associated with the workspace.", + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Optional: true, }, "ids": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, + Description: "The list of workspace IDs, in the format [`ws-xxxxxxxxxxx`, `ws-yyyyyyyyy`].", + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, }, }, } diff --git a/scalr/provider.go b/scalr/provider.go index 870a2dd7..51448cc8 100644 --- a/scalr/provider.go +++ b/scalr/provider.go @@ -44,16 +44,21 @@ func Provider() *schema.Provider { return &schema.Provider{ Schema: map[string]*schema.Schema{ "hostname": { - Type: schema.TypeString, - Optional: true, - Description: fmt.Sprintf("Scalr instance hostname without scheme. Defaults to %s.", defaultHostname), + Type: schema.TypeString, + Optional: true, + Description: fmt.Sprintf("The Scalr hostname to connect to. Defaults to `%s`."+ + " Can be overridden by setting the `SCALR_HOSTNAME` environment variable.", + defaultHostname), DefaultFunc: schema.EnvDefaultFunc("SCALR_HOSTNAME", defaultHostname), }, "token": { - Type: schema.TypeString, - Optional: true, - Description: "Scalr API token.", + Type: schema.TypeString, + Optional: true, + Description: "The token used to authenticate with Scalr." + + " Can be overridden by setting the `SCALR_TOKEN` environment variable." + + " See [Scalr provider configuration](/docs/scalr)" + + " for information on generating a token.", DefaultFunc: schema.EnvDefaultFunc("SCALR_TOKEN", nil), }, }, diff --git a/scalr/resource_scalr_access_policy.go b/scalr/resource_scalr_access_policy.go index efde3911..ec135208 100644 --- a/scalr/resource_scalr_access_policy.go +++ b/scalr/resource_scalr_access_policy.go @@ -44,6 +44,7 @@ func (s Subject) IsValid() error { func resourceScalrAccessPolicy() *schema.Resource { return &schema.Resource{ + Description: "Manages the Scalr IAM access policies. Create, update and destroy.", CreateContext: resourceScalrAccessPolicyCreate, ReadContext: resourceScalrAccessPolicyRead, UpdateContext: resourceScalrAccessPolicyUpdate, @@ -54,24 +55,28 @@ func resourceScalrAccessPolicy() *schema.Resource { SchemaVersion: 0, Schema: map[string]*schema.Schema{ "is_system": { - Type: schema.TypeBool, - Computed: true, + Description: "The access policy is a built-in read-only policy that cannot be updated or deleted.", + Type: schema.TypeBool, + Computed: true, }, "subject": { - Type: schema.TypeList, - Required: true, - MaxItems: 1, + Description: "Defines the subject of the access policy.", + Type: schema.TypeList, + Required: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The subject ID, `user-` for user, `team-` for team, `sa-` for service account.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The subject type, is one of `user`, `team`, or `service_account`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { v := val.(string) if err := Subject(v).IsValid(); err != nil { @@ -84,20 +89,23 @@ func resourceScalrAccessPolicy() *schema.Resource { }, }, "scope": { - Type: schema.TypeList, - Required: true, - MaxItems: 1, + Description: "Defines the scope where access policy is applied.", + Type: schema.TypeList, + Required: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The scope identity type, is one of `account`, `environment`, or `workspace`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { v := val.(string) if err := Scope(v).IsValid(); err != nil { @@ -109,11 +117,12 @@ func resourceScalrAccessPolicy() *schema.Resource { }, }, "role_ids": { - Type: schema.TypeList, - Required: true, - MinItems: 1, - MaxItems: 128, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of the role IDs.", + Type: schema.TypeList, + Required: true, + MinItems: 1, + MaxItems: 128, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_account_allowed_ips.go b/scalr/resource_scalr_account_allowed_ips.go index 4f412e6d..8027e404 100644 --- a/scalr/resource_scalr_account_allowed_ips.go +++ b/scalr/resource_scalr_account_allowed_ips.go @@ -15,6 +15,7 @@ import ( func resourceScalrAccountAllowedIps() *schema.Resource { return &schema.Resource{ + Description: "Manages the list of allowed IPs for an account in Scalr. Create, update and destroy.", CreateContext: resourceScalrAccountAllowedIpsCreate, ReadContext: resourceScalrAccountAllowedIpsRead, UpdateContext: resourceScalrAccountAllowedIpsUpdate, @@ -24,7 +25,13 @@ func resourceScalrAccountAllowedIps() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "id": { + Description: "The ID of this resource. Equals to the ID of the account.", + Type: schema.TypeString, + Computed: true, + }, "account_id": { + Description: "ID of the account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -32,6 +39,9 @@ func resourceScalrAccountAllowedIps() *schema.Resource { }, "allowed_ips": { + Description: "The list of allowed IPs or CIDRs." + + "\n\n **Warning**: if you don't specify the current IP address, you may lose access to the account." + + " To restore it the account owner has to raise a [support ticket](https://support.scalr.com).", Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, MinItems: 1, diff --git a/scalr/resource_scalr_agent_pool.go b/scalr/resource_scalr_agent_pool.go index 4ddf749b..ec4b7420 100644 --- a/scalr/resource_scalr_agent_pool.go +++ b/scalr/resource_scalr_agent_pool.go @@ -12,6 +12,7 @@ import ( func resourceScalrAgentPool() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of agent pools in Scalr. Create, update and destroy.", CreateContext: resourceScalrAgentPoolCreate, ReadContext: resourceScalrAgentPoolRead, UpdateContext: resourceScalrAgentPoolUpdate, @@ -22,10 +23,12 @@ func resourceScalrAgentPool() *schema.Resource { SchemaVersion: 0, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the agent pool.", + Type: schema.TypeString, + Required: true, }, "account_id": { + Description: "ID of the account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -34,14 +37,16 @@ func resourceScalrAgentPool() *schema.Resource { }, "environment_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Description: "ID of the environment.", + Type: schema.TypeString, + Optional: true, + ForceNew: true, }, "vcs_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Indicates whether the VCS support is enabled for agents in the pool.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, }, } diff --git a/scalr/resource_scalr_agent_pool_token.go b/scalr/resource_scalr_agent_pool_token.go index 03bcbd4b..27becff1 100644 --- a/scalr/resource_scalr_agent_pool_token.go +++ b/scalr/resource_scalr_agent_pool_token.go @@ -12,6 +12,7 @@ import ( func resourceScalrAgentPoolToken() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of agent pool's tokens in Scalr. Create, update and destroy.", CreateContext: resourceScalrAgentPoolTokenCreate, ReadContext: resourceScalrAgentPoolTokenRead, UpdateContext: resourceScalrAgentPoolTokenUpdate, @@ -19,18 +20,21 @@ func resourceScalrAgentPoolToken() *schema.Resource { SchemaVersion: 0, Schema: map[string]*schema.Schema{ "description": { - Type: schema.TypeString, - Required: true, + Description: "Description of the token.", + Type: schema.TypeString, + Required: true, }, "agent_pool_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the agent pool.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "token": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Description: "The token of the agent pool.", + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, }, } diff --git a/scalr/resource_scalr_endpoint.go b/scalr/resource_scalr_endpoint.go index bbfe5825..b18bf73a 100644 --- a/scalr/resource_scalr_endpoint.go +++ b/scalr/resource_scalr_endpoint.go @@ -12,6 +12,7 @@ import ( func resourceScalrEndpoint() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of endpoints in Scalr. Create, update and destroy.", DeprecationMessage: "Resource `scalr_endpoint` is deprecated, the endpoint information" + " is included in the `scalr_webhook` resource.", CreateContext: resourceScalrEndpointCreate, @@ -32,37 +33,43 @@ func resourceScalrEndpoint() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the endpoint.", + Type: schema.TypeString, + Required: true, }, "max_attempts": { - Type: schema.TypeInt, - Optional: true, - Computed: true, + Description: "Max delivery attempts.", + Type: schema.TypeInt, + Optional: true, + Computed: true, }, "url": { - Type: schema.TypeString, - Required: true, + Description: "Endpoint URL.", + Type: schema.TypeString, + Required: true, }, "secret_key": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Sensitive: true, + Description: "Secret key to sign payload.", + Type: schema.TypeString, + Optional: true, + Computed: true, + Sensitive: true, }, "timeout": { - Type: schema.TypeInt, - Optional: true, - Computed: true, + Description: "Endpoint timeout (in sec).", + Type: schema.TypeInt, + Optional: true, + Computed: true, }, "environment_id": { - Type: schema.TypeString, - Required: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Required: true, }, }, } diff --git a/scalr/resource_scalr_environment.go b/scalr/resource_scalr_environment.go index 6195b82c..49784e22 100644 --- a/scalr/resource_scalr_environment.go +++ b/scalr/resource_scalr_environment.go @@ -13,6 +13,7 @@ import ( func resourceScalrEnvironment() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of environments in Scalr. Creates, updates and destroys.", CreateContext: resourceScalrEnvironmentCreate, ReadContext: resourceScalrEnvironmentRead, DeleteContext: resourceScalrEnvironmentDelete, @@ -23,39 +24,47 @@ func resourceScalrEnvironment() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the environment.", + Type: schema.TypeString, + Required: true, }, "cost_estimation_enabled": { - Type: schema.TypeBool, - Computed: true, - Optional: true, + Description: "Set (true/false) to enable/disable cost estimation for the environment. Default `true`.", + Type: schema.TypeBool, + Computed: true, + Optional: true, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "The status of the environment.", + Type: schema.TypeString, + Computed: true, }, "created_by": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the user that created the environment.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of creator.", + Type: schema.TypeString, + Computed: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "Email address of creator.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "Full name of creator.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "account_id": { + Description: "ID of the environment account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -63,21 +72,24 @@ func resourceScalrEnvironment() *schema.Resource { ForceNew: true, }, "policy_groups": { - Type: schema.TypeList, - Computed: true, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of the environment policy-groups IDs, in the format `pgrp-`.", + Type: schema.TypeList, + Computed: true, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "default_provider_configurations": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Computed: true, + Description: "List of IDs of provider configurations, used in the environment workspaces by default.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, }, "tag_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of tag IDs associated with the environment.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_iam_team.go b/scalr/resource_scalr_iam_team.go index 52b5653d..b9f82e6e 100644 --- a/scalr/resource_scalr_iam_team.go +++ b/scalr/resource_scalr_iam_team.go @@ -13,6 +13,7 @@ import ( func resourceScalrIamTeam() *schema.Resource { return &schema.Resource{ + Description: "Manages the Scalr IAM teams: performs create, update and destroy actions.", CreateContext: resourceScalrIamTeamCreate, ReadContext: resourceScalrIamTeamRead, UpdateContext: resourceScalrIamTeamUpdate, @@ -23,14 +24,17 @@ func resourceScalrIamTeam() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "A name of the team.", + Type: schema.TypeString, + Required: true, }, "description": { - Type: schema.TypeString, - Optional: true, + Description: "A verbose description of the team.", + Type: schema.TypeString, + Optional: true, }, "account_id": { + Description: "An identifier of the Scalr account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -38,15 +42,17 @@ func resourceScalrIamTeam() *schema.Resource { ForceNew: true, }, "identity_provider_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Description: "An identifier of the login identity provider, in the format `idp-`. This is required when `account_id` is not specified.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, }, "users": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of the user identifiers to add to the team.", + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_module.go b/scalr/resource_scalr_module.go index 7f15fbb4..f1e8213c 100644 --- a/scalr/resource_scalr_module.go +++ b/scalr/resource_scalr_module.go @@ -12,6 +12,7 @@ import ( func resourceScalrModule() *schema.Resource { return &schema.Resource{ + Description: "Manages the state of a module in the Private Modules Registry. Create and destroy operations are available only.", CreateContext: resourceScalrModuleCreate, ReadContext: resourceScalrModuleRead, DeleteContext: resourceScalrModuleDelete, @@ -20,53 +21,63 @@ func resourceScalrModule() *schema.Resource { }, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Computed: true, + Description: "Name of the module, e.g. `rds`, `compute`, `kubernetes-engine`.", + Type: schema.TypeString, + Computed: true, }, "module_provider": { - Type: schema.TypeString, - Computed: true, + Description: "Module provider name, e.g `aws`, `azurerm`, `google`, etc.", + Type: schema.TypeString, + Computed: true, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "A system status of the Module.", + Type: schema.TypeString, + Computed: true, }, "source": { - Type: schema.TypeString, - Computed: true, + Description: "The source of a remote module in the private registry, e.g `env-xxxx/aws/vpc`.", + Type: schema.TypeString, + Computed: true, }, "vcs_repo": { - Type: schema.TypeList, - Required: true, - MinItems: 1, - MaxItems: 1, - ForceNew: true, + Description: "Source configuration of a VCS repository.", + Type: schema.TypeList, + Required: true, + MinItems: 1, + MaxItems: 1, + ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "identifier": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The identifier of a VCS repository in the format `:org/:repo` (`:org/:project/:name` is used for Azure DevOps). It refers to an organization and a repository name in a VCS provider.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "path": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Description: "The path to the root module folder. It is expected to have the format `/terraform--`, where `` stands for any folder within the repository inclusively a repository root.", + Type: schema.TypeString, + Optional: true, + ForceNew: true, }, "tag_prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Description: "Registry ignores tags which do not match specified prefix, e.g. `aws/`.", + Type: schema.TypeString, + Optional: true, + ForceNew: true, }, }, }, }, "vcs_provider_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The identifier of a VCS provider in the format `vcs-`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "account_id": { + Description: "The identifier of the account in the format `acc-`. If it is not specified the module will be registered globally and available across the whole installation.", Type: schema.TypeString, Optional: true, Computed: true, @@ -74,9 +85,10 @@ func resourceScalrModule() *schema.Resource { ForceNew: true, }, "environment_id": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, + Description: "The identifier of an environment in the format `env-`. If it is not specified the module will be registered at the account level and available across all environments within the account specified in `account_id` attribute.", + Type: schema.TypeString, + ForceNew: true, + Optional: true, }, }, } diff --git a/scalr/resource_scalr_policy_group.go b/scalr/resource_scalr_policy_group.go index 847c6af8..9adc36e9 100644 --- a/scalr/resource_scalr_policy_group.go +++ b/scalr/resource_scalr_policy_group.go @@ -12,6 +12,7 @@ import ( func resourceScalrPolicyGroup() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of policy groups in Scalr. Create, update and destroy.", CreateContext: resourceScalrPolicyGroupCreate, ReadContext: resourceScalrPolicyGroupRead, UpdateContext: resourceScalrPolicyGroupUpdate, @@ -22,46 +23,55 @@ func resourceScalrPolicyGroup() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "The name of a policy group.", + Type: schema.TypeString, + Required: true, }, "status": { - Type: schema.TypeString, - Computed: true, + Description: "A system status of the Policy group.", + Type: schema.TypeString, + Computed: true, }, "error_message": { - Type: schema.TypeString, - Computed: true, + Description: "A detailed error if Scalr failed to process the policy group.", + Type: schema.TypeString, + Computed: true, }, "opa_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "vcs_repo": { - Type: schema.TypeList, - Required: true, - MinItems: 1, - MaxItems: 1, + Description: "The VCS meta-data to create the policy from.", + Type: schema.TypeList, + Required: true, + MinItems: 1, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "identifier": { - Type: schema.TypeString, - Required: true, + Description: "The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider.", + Type: schema.TypeString, + Required: true, }, "branch": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The branch of a repository the policy group is associated with. If omitted, the repository default branch will be used.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "path": { - Type: schema.TypeString, - Optional: true, + Description: "The subdirectory of the VCS repository where OPA policies are stored. If omitted or submitted as an empty string, this defaults to the repository's root.", + Type: schema.TypeString, + Optional: true, }, }, }, }, "account_id": { + Description: "The identifier of the Scalr account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -69,33 +79,39 @@ func resourceScalrPolicyGroup() *schema.Resource { ForceNew: true, }, "vcs_provider_id": { - Type: schema.TypeString, - Required: true, + Description: "The identifier of a VCS provider, in the format `vcs-`.", + Type: schema.TypeString, + Required: true, }, "policies": { - Type: schema.TypeList, - Computed: true, + Description: "A list of the OPA policies the group verifies each run.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Computed: true, + Description: "A name of the policy.", + Type: schema.TypeString, + Computed: true, }, "enabled": { - Type: schema.TypeBool, - Computed: true, + Description: "If set to `false`, the policy will not be verified during a run.", + Type: schema.TypeBool, + Computed: true, }, "enforced_level": { - Type: schema.TypeString, - Computed: true, + Description: "An enforcement level of the policy.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "environments": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of the environments the policy group is linked to.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_policy_group_linkage.go b/scalr/resource_scalr_policy_group_linkage.go index 727429d1..b63f7dc7 100644 --- a/scalr/resource_scalr_policy_group_linkage.go +++ b/scalr/resource_scalr_policy_group_linkage.go @@ -14,6 +14,7 @@ import ( func resourceScalrPolicyGroupLinkage() *schema.Resource { return &schema.Resource{ + Description: "Manage policy group to environment linking in Scalr. Create, update and destroy.", CreateContext: resourceScalrPolicyGroupLinkageCreate, ReadContext: resourceScalrPolicyGroupLinkageRead, DeleteContext: resourceScalrPolicyGroupLinkageDelete, @@ -22,15 +23,22 @@ func resourceScalrPolicyGroupLinkage() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "id": { + Description: "The ID of the policy group linkage. It is a combination of the policy group and environment IDs in the format `pgrp-xxxxxxxxxxxxxxx/env-yyyyyyyyyyyyyyy`", + Type: schema.TypeString, + Computed: true, + }, "policy_group_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the policy group, in the format `pgrp-`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "environment_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, }, } diff --git a/scalr/resource_scalr_provider_configuration.go b/scalr/resource_scalr_provider_configuration.go index 9b650571..f7e7fe12 100644 --- a/scalr/resource_scalr_provider_configuration.go +++ b/scalr/resource_scalr_provider_configuration.go @@ -17,6 +17,10 @@ const numParallel = 10 func resourceScalrProviderConfiguration() *schema.Resource { return &schema.Resource{ + Description: "A provider configuration helps organizations manage provider secrets in a centralized way." + + " It natively supports the management of the major providers like Scalr, AWS, AzureRM," + + " and Google Cloud Platform, but also allows registering any custom provider." + + " Please have a look at the basic usage examples for each provider type.", CreateContext: resourceScalrProviderConfigurationCreate, ReadContext: resourceScalrProviderConfigurationRead, UpdateContext: resourceScalrProviderConfigurationUpdate, @@ -43,6 +47,7 @@ func resourceScalrProviderConfiguration() *schema.Resource { SchemaVersion: 0, Schema: map[string]*schema.Schema{ "account_id": { + Description: "The account that owns the object, specified as an ID.", Type: schema.TypeString, Optional: true, Computed: true, @@ -50,20 +55,24 @@ func resourceScalrProviderConfiguration() *schema.Resource { ForceNew: true, }, "name": { - Type: schema.TypeString, - Required: true, + Description: "The name of the Scalr provider configuration. This field is unique for the account.", + Type: schema.TypeString, + Required: true, }, "export_shell_variables": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Export provider variables into the run environment. This option is available for built-in (Scalr, AWS, AzureRM, Google) providers only.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "environments": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of environment identifiers that the provider configuration is shared to. Use `[\"*\"]` to share with all environments.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "aws": { + Description: "Settings for the aws provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`.", Type: schema.TypeList, Optional: true, MaxItems: 1, @@ -71,43 +80,52 @@ func resourceScalrProviderConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "account_type": { - Type: schema.TypeString, - Optional: true, - Default: "regular", + Description: "The type of AWS account, available options: `regular`, `gov-cloud`, `cn-cloud`.", + Type: schema.TypeString, + Optional: true, + Default: "regular", }, "credentials_type": { - Type: schema.TypeString, - Required: true, + Description: "The type of AWS credentials, available options: `access_keys`, `role_delegation`, `oidc`.", + Type: schema.TypeString, + Required: true, }, "trusted_entity_type": { - Type: schema.TypeString, - Optional: true, + Description: "Trusted entity type, available options: `aws_account`, `aws_service`. This option is required with `role_delegation` credentials type.", + Type: schema.TypeString, + Optional: true, }, "role_arn": { - Type: schema.TypeString, - Optional: true, + Description: "Amazon Resource Name (ARN) of the IAM Role to assume. This option is required with the `role_delegation` and `oidc` credentials type.", + Type: schema.TypeString, + Optional: true, }, "external_id": { - Type: schema.TypeString, - Optional: true, + Description: "External identifier to use when assuming the role. This option is required with `role_delegation` credentials type and `aws_account` trusted entity type.", + Type: schema.TypeString, + Optional: true, }, "access_key": { - Type: schema.TypeString, - Optional: true, + Description: "AWS access key. This option is required with `access_keys` credentials type.", + Type: schema.TypeString, + Optional: true, }, "secret_key": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, + Description: "AWS secret key. This option is required with `access_keys` credentials type.", + Type: schema.TypeString, + Optional: true, + Sensitive: true, }, "audience": { - Type: schema.TypeString, - Optional: true, + Description: "The value of the `aud` claim for the identity token. This option is required with `oidc` credentials type.", + Type: schema.TypeString, + Optional: true, }, }, }, }, "google": { + Description: "Settings for the google provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`.", Type: schema.TypeList, Optional: true, MaxItems: 1, @@ -115,32 +133,38 @@ func resourceScalrProviderConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "auth_type": { - Type: schema.TypeString, - Optional: true, - Default: "service-account-key", + Description: "Authentication type, either `service-account-key` (default) or `oidc`.", + Type: schema.TypeString, + Optional: true, + Default: "service-account-key", }, "project": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The default project to manage resources in. If another project is specified on a resource, it will take precedence.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "credentials": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, + Description: "Service account key file in JSON format, required when `auth_type` is `service-account-key`.", + Type: schema.TypeString, + Optional: true, + Sensitive: true, }, "service_account_email": { - Type: schema.TypeString, - Optional: true, + Description: "The service account email used to authenticate to GCP, required when `auth_type` is `oidc`.", + Type: schema.TypeString, + Optional: true, }, "workload_provider_name": { - Type: schema.TypeString, - Optional: true, + Description: "The canonical name of the workload identity provider, required when `auth_type` is `oidc`.", + Type: schema.TypeString, + Optional: true, }, }, }, }, "azurerm": { + Description: "Settings for the azurerm provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`.", Type: schema.TypeList, Optional: true, MaxItems: 1, @@ -148,34 +172,41 @@ func resourceScalrProviderConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "auth_type": { - Type: schema.TypeString, - Optional: true, - Default: "client-secrets", + Description: "Authentication type, either `client-secrets` (default) or `oidc`.", + Type: schema.TypeString, + Optional: true, + Default: "client-secrets", }, "audience": { - Type: schema.TypeString, - Optional: true, + Description: "The value of the `aud` claim for the identity token. This option is required with `oidc` authentication type.", + Type: schema.TypeString, + Optional: true, }, "client_id": { - Type: schema.TypeString, - Required: true, + Description: "The Client ID that should be used.", + Type: schema.TypeString, + Required: true, }, "client_secret": { - Type: schema.TypeString, - Optional: true, + Description: "The Client Secret that should be used, required when `auth_type` is `client-secrets`.", + Type: schema.TypeString, + Optional: true, }, "tenant_id": { - Type: schema.TypeString, - Required: true, + Description: "The Tenant ID that should be used.", + Type: schema.TypeString, + Required: true, }, "subscription_id": { - Type: schema.TypeString, - Optional: true, + Description: "The Subscription ID that should be used. If skipped, it must be set as a shell variable in the workspace or as a part of the source configuration.", + Type: schema.TypeString, + Optional: true, }, }, }, }, "scalr": { + Description: "Settings for the Scalr provider configuration. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`.", Type: schema.TypeList, Optional: true, MaxItems: 1, @@ -183,18 +214,21 @@ func resourceScalrProviderConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "hostname": { - Type: schema.TypeString, - Required: true, + Description: "The Scalr hostname which should be used.", + Type: schema.TypeString, + Required: true, }, "token": { - Type: schema.TypeString, - Required: true, - Sensitive: true, + Description: "The Scalr token which should be used.", + Type: schema.TypeString, + Required: true, + Sensitive: true, }, }, }, }, "custom": { + Description: "Settings for the provider configuration that does not have scalr support as a built-in provider. Exactly one of the following attributes must be set: `scalr`, `aws`, `google`, `azurerm`, `custom`.", Type: schema.TypeList, Optional: true, MaxItems: 1, @@ -202,32 +236,38 @@ func resourceScalrProviderConfiguration() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "provider_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The name of a Terraform provider.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "argument": { - Type: schema.TypeSet, - Required: true, - MinItems: 1, + Description: "The provider configuration argument. Multiple instances are allowed per block.", + Type: schema.TypeSet, + Required: true, + MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "The name of the provider configuration argument.", + Type: schema.TypeString, + Required: true, }, "value": { - Type: schema.TypeString, - Optional: true, + Description: "The value of the provider configuration argument.", + Type: schema.TypeString, + Optional: true, }, "sensitive": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure as sensitive. Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "description": { - Type: schema.TypeString, - Optional: true, + Description: "The description of the provider configuration argument.", + Type: schema.TypeString, + Optional: true, }, }, }, diff --git a/scalr/resource_scalr_provider_configuration_default.go b/scalr/resource_scalr_provider_configuration_default.go index f71c956d..6d23c61c 100644 --- a/scalr/resource_scalr_provider_configuration_default.go +++ b/scalr/resource_scalr_provider_configuration_default.go @@ -16,6 +16,10 @@ var resourceScalrProviderConfigurationDefaultMutex sync.Mutex func resourceScalrProviderConfigurationDefault() *schema.Resource { return &schema.Resource{ + Description: "Manage defaults of provider configurations for environments in Scalr. Create and destroy." + + "\n\n**Note:** To make the provider configuration default, it must be shared with the specified environment." + + " See the definition of the resource [`scalr_provider_configuration`](provider_configuration.md)" + + " and attribute `environments` to learn more.", CreateContext: resourceScalrProviderConfigurationDefaultCreate, ReadContext: resourceScalrProviderConfigurationDefaultRead, DeleteContext: resourceScalrProviderConfigurationDefaultDelete, @@ -24,15 +28,22 @@ func resourceScalrProviderConfigurationDefault() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "id": { + Description: "The ID of the provider configuration default. It is a combination of the environment and provider configuration IDs in the format `env-xxxxxxxx/pcfg-xxxxxxxx`", + Type: schema.TypeString, + Computed: true, + }, "provider_configuration_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the provider configuration, in the format `pcfg-`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "environment_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, }, } diff --git a/scalr/resource_scalr_role.go b/scalr/resource_scalr_role.go index 57619de3..c633d81f 100644 --- a/scalr/resource_scalr_role.go +++ b/scalr/resource_scalr_role.go @@ -15,6 +15,7 @@ import ( func resourceScalrRole() *schema.Resource { return &schema.Resource{ + Description: "Manage the Scalr IAM roles. Create, update and destroy.", CreateContext: resourceScalrRoleCreate, ReadContext: resourceScalrRoleRead, UpdateContext: resourceScalrRoleUpdate, @@ -32,10 +33,12 @@ func resourceScalrRole() *schema.Resource { }, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the role.", + Type: schema.TypeString, + Required: true, }, "account_id": { + Description: "ID of the account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -44,21 +47,24 @@ func resourceScalrRole() *schema.Resource { }, "is_system": { - Type: schema.TypeBool, - Computed: true, + Description: "Boolean indicates if the role can be edited. System roles are maintained by Scalr and cannot be changed.", + Type: schema.TypeBool, + Computed: true, }, "description": { - Type: schema.TypeString, - Optional: true, + Description: "Verbose description of the role.", + Type: schema.TypeString, + Optional: true, }, "permissions": { - Type: schema.TypeList, - Required: true, - MinItems: 1, - MaxItems: 128, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Array of permission names.", + Type: schema.TypeList, + Required: true, + MinItems: 1, + MaxItems: 128, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_run_triggers.go b/scalr/resource_scalr_run_triggers.go index 96ca3a46..258b90b3 100644 --- a/scalr/resource_scalr_run_triggers.go +++ b/scalr/resource_scalr_run_triggers.go @@ -12,20 +12,28 @@ import ( func resourceScalrRunTrigger() *schema.Resource { return &schema.Resource{ + Description: "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.", CreateContext: resourceScalrRunTriggerCreate, DeleteContext: resourceScalrRunTriggerDelete, ReadContext: resourceScalrRunTriggerRead, Schema: map[string]*schema.Schema{ "downstream_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The identifier of the workspace in which new runs will be triggered.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "upstream_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The identifier of the upstream workspace.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, }, } diff --git a/scalr/resource_scalr_service_account.go b/scalr/resource_scalr_service_account.go index d58b6d99..7644b3e4 100644 --- a/scalr/resource_scalr_service_account.go +++ b/scalr/resource_scalr_service_account.go @@ -12,6 +12,7 @@ import ( func resourceScalrServiceAccount() *schema.Resource { return &schema.Resource{ + Description: "Manages the state of service accounts in Scalr.", CreateContext: resourceScalrServiceAccountCreate, ReadContext: resourceScalrServiceAccountRead, UpdateContext: resourceScalrServiceAccountUpdate, @@ -22,22 +23,26 @@ func resourceScalrServiceAccount() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "Name of the service account.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "The email of the service account.", + Type: schema.TypeString, + Computed: true, }, "description": { - Type: schema.TypeString, - Optional: true, + Description: "Description of the service account.", + Type: schema.TypeString, + Optional: true, }, "status": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The status of the service account. Valid values are `Active` and `Inactive`. Defaults to `Active`.", + Type: schema.TypeString, + Optional: true, + Computed: true, ValidateFunc: validation.StringInSlice( []string{ string(scalr.ServiceAccountStatusActive), @@ -47,6 +52,7 @@ func resourceScalrServiceAccount() *schema.Resource { ), }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -54,21 +60,25 @@ func resourceScalrServiceAccount() *schema.Resource { ForceNew: true, }, "created_by": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the user that created the service account.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of creator.", + Type: schema.TypeString, + Computed: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "Email address of creator.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "Full name of creator.", + Type: schema.TypeString, + Computed: true, }, }, }, diff --git a/scalr/resource_scalr_service_account_token.go b/scalr/resource_scalr_service_account_token.go index 7281ce59..7a85b82c 100644 --- a/scalr/resource_scalr_service_account_token.go +++ b/scalr/resource_scalr_service_account_token.go @@ -12,24 +12,28 @@ import ( func resourceScalrServiceAccountToken() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of service account's tokens in Scalr. Create, update and destroy.", CreateContext: resourceScalrServiceAccountTokenCreate, ReadContext: resourceScalrServiceAccountTokenRead, UpdateContext: resourceScalrServiceAccountTokenUpdate, DeleteContext: resourceScalrServiceAccountTokenDelete, Schema: map[string]*schema.Schema{ "service_account_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the service account.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "description": { - Type: schema.TypeString, - Optional: true, + Description: "Description of the token.", + Type: schema.TypeString, + Optional: true, }, "token": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Description: "The token of the service account.", + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, }, } diff --git a/scalr/resource_scalr_slack_integration.go b/scalr/resource_scalr_slack_integration.go index 777a3572..f613187b 100644 --- a/scalr/resource_scalr_slack_integration.go +++ b/scalr/resource_scalr_slack_integration.go @@ -12,6 +12,8 @@ import ( func resourceScalrSlackIntegration() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of Slack integrations in Scalr. Create, update and destroy." + + "\n\n**Note:** Slack workspace should be connected to Scalr account before using this resource.", CreateContext: resourceScalrSlackIntegrationCreate, ReadContext: resourceScalrSlackIntegrationRead, UpdateContext: resourceScalrSlackIntegrationUpdate, @@ -22,12 +24,14 @@ func resourceScalrSlackIntegration() *schema.Resource { SchemaVersion: 0, Schema: map[string]*schema.Schema{ "name": { + Description: "Name of the Slack integration.", Type: schema.TypeString, Required: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace), }, "events": { - Type: schema.TypeSet, + Description: "Terraform run events you would like to receive a Slack notifications for. Supported values are `run_approval_required`, `run_success`, `run_errored`.", + Type: schema.TypeSet, Elem: &schema.Schema{ Type: schema.TypeString, ValidateDiagFunc: validation.ToDiagFunc( @@ -45,11 +49,13 @@ func resourceScalrSlackIntegration() *schema.Resource { MinItems: 1, }, "channel_id": { + Description: "Slack channel ID the event will be sent to.", Type: schema.TypeString, Required: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace), }, "account_id": { + Description: "ID of the account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -57,7 +63,8 @@ func resourceScalrSlackIntegration() *schema.Resource { ForceNew: true, }, "environments": { - Type: schema.TypeSet, + Description: "List of environments where events should be triggered.", + Type: schema.TypeSet, Elem: &schema.Schema{ Type: schema.TypeString, ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace), @@ -66,7 +73,8 @@ func resourceScalrSlackIntegration() *schema.Resource { MinItems: 1, }, "workspaces": { - Type: schema.TypeSet, + Description: "List of workspaces where events should be triggered. Workspaces should be in provided environments. If no workspace is given for a specified environment, events will trigger in all of its workspaces.", + Type: schema.TypeSet, Elem: &schema.Schema{ Type: schema.TypeString, ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace), diff --git a/scalr/resource_scalr_tag.go b/scalr/resource_scalr_tag.go index 8592047b..487272ba 100644 --- a/scalr/resource_scalr_tag.go +++ b/scalr/resource_scalr_tag.go @@ -11,6 +11,7 @@ import ( func resourceScalrTag() *schema.Resource { return &schema.Resource{ + Description: "Manages the state of tags in Scalr.", CreateContext: resourceScalrTagCreate, ReadContext: resourceScalrTagRead, UpdateContext: resourceScalrTagUpdate, @@ -21,10 +22,12 @@ func resourceScalrTag() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the tag.", + Type: schema.TypeString, + Required: true, }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, diff --git a/scalr/resource_scalr_variable.go b/scalr/resource_scalr_variable.go index a2b2231d..379fc70f 100644 --- a/scalr/resource_scalr_variable.go +++ b/scalr/resource_scalr_variable.go @@ -15,6 +15,7 @@ import ( func resourceScalrVariable() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of the variables in Scalr. Create, update and destroy.", CreateContext: resourceScalrVariableCreate, ReadContext: resourceScalrVariableRead, UpdateContext: resourceScalrVariableUpdate, @@ -57,21 +58,24 @@ func resourceScalrVariable() *schema.Resource { Schema: map[string]*schema.Schema{ "key": { - Type: schema.TypeString, - Required: true, + Description: "Key of the variable.", + Type: schema.TypeString, + Required: true, }, "value": { - Type: schema.TypeString, - Optional: true, - Default: "", - Sensitive: true, + Description: "Variable value.", + Type: schema.TypeString, + Optional: true, + Default: "", + Sensitive: true, }, "category": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "Indicates if this is a Terraform or shell variable. Allowed values are `terraform` or `shell`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice( []string{ string(scalr.CategoryEnv), @@ -83,48 +87,56 @@ func resourceScalrVariable() *schema.Resource { }, "hcl": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure the variable as a string of HCL code. Has no effect for `category = \"shell\"` variables. Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "sensitive": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure as sensitive. Sensitive variable values are not visible after being set. Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "description": { - Type: schema.TypeString, - Optional: true, + Description: "Variable verbose description, defaults to empty string.", + Type: schema.TypeString, + Optional: true, }, "final": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "force": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure as force. Allows creating final variables on higher scope, even if the same variable exists on lower scope (lower is to be deleted). Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "workspace_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Description: "The workspace that owns the variable, specified as an ID, in the format `ws-`.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, }, "environment_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Description: "The environment that owns the variable, specified as an ID, in the format `env-`.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, }, "account_id": { + Description: "The account that owns the variable, specified as an ID, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, diff --git a/scalr/resource_scalr_vcs_provider.go b/scalr/resource_scalr_vcs_provider.go index e0419440..29559660 100644 --- a/scalr/resource_scalr_vcs_provider.go +++ b/scalr/resource_scalr_vcs_provider.go @@ -13,6 +13,7 @@ import ( func resourceScalrVcsProvider() *schema.Resource { return &schema.Resource{ + Description: "Manage the Scalr VCS provider. Create, update and destroy.", CreateContext: resourceScalrVcsProviderCreate, ReadContext: resourceScalrVcsProviderRead, UpdateContext: resourceScalrVcsProviderUpdate, @@ -30,18 +31,21 @@ func resourceScalrVcsProvider() *schema.Resource { }, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the vcs provider.", + Type: schema.TypeString, + Required: true, }, "url": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "This field is required for self-hosted vcs providers.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "vcs_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "The vcs provider type is one of `github`, `github_enterprise`, `gitlab`, `gitlab_enterprise`, `bitbucket_enterprise`. The other providers are not currently supported in the resource.", + Type: schema.TypeString, + Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice( []string{ string(scalr.Github), @@ -54,15 +58,20 @@ func resourceScalrVcsProvider() *schema.Resource { ), }, "token": { + Description: "The personal access token for the provider." + + "\n * GitHub token can be generated by url https://github.com/settings/tokens/new?description=example-vcs-resouce&scopes=repo" + + "\n * Gitlab token can be generated by url https://gitlab.com/-/profile/personal_access_tokens?name=example-vcs-resouce&scopes=api,read_user,read_registry", Type: schema.TypeString, Required: true, Sensitive: true, }, "username": { - Type: schema.TypeString, - Optional: true, + Description: "This field is required for `bitbucket_enterprise` provider type.", + Type: schema.TypeString, + Optional: true, }, "account_id": { + Description: "ID of the account.", Type: schema.TypeString, Optional: true, Computed: true, @@ -70,14 +79,16 @@ func resourceScalrVcsProvider() *schema.Resource { ForceNew: true, }, "agent_pool_id": { - Type: schema.TypeString, - Optional: true, + Description: "The id of the agent pool to connect Scalr to self-hosted VCS provider.", + Type: schema.TypeString, + Optional: true, }, "environments": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of environment identifiers that the VCS provider is shared to. Use `[\"*\"]` to share with all environments.", + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_webhook.go b/scalr/resource_scalr_webhook.go index c21b58ef..96bdb3b8 100644 --- a/scalr/resource_scalr_webhook.go +++ b/scalr/resource_scalr_webhook.go @@ -14,6 +14,7 @@ import ( func resourceScalrWebhook() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of webhooks in Scalr. Creates, updates and destroy.", CreateContext: resourceScalrWebhookCreate, ReadContext: resourceScalrWebhookRead, UpdateContext: resourceScalrWebhookUpdate, @@ -32,24 +33,28 @@ func resourceScalrWebhook() *schema.Resource { }, Schema: map[string]*schema.Schema{ "name": { + Description: "Name of the webhook.", Type: schema.TypeString, Required: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace), }, "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, + Description: "Set (true/false) to enable/disable the webhook.", + Type: schema.TypeBool, + Optional: true, + Default: true, }, "last_triggered_at": { - Type: schema.TypeString, - Computed: true, + Description: "Date/time when webhook was last triggered.", + Type: schema.TypeString, + Computed: true, }, "events": { - Type: schema.TypeList, + Description: "List of event IDs.", + Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, ValidateDiagFunc: validation.ToDiagFunc( @@ -64,8 +69,9 @@ func resourceScalrWebhook() *schema.Resource { }, "endpoint_id": { - Type: schema.TypeString, - Optional: true, + Description: "ID of the endpoint, in the format `ep-`.", + Type: schema.TypeString, + Optional: true, Deprecated: "Attribute `endpoint_id` is deprecated, please set the endpoint information" + " in the webhook itself.", // If `endpoint_id` is set in configuration, we consider this an old-style webhook, @@ -80,6 +86,7 @@ func resourceScalrWebhook() *schema.Resource { }, "url": { + Description: "Endpoint URL. Required if `endpoint_id` is not set.", Type: schema.TypeString, Optional: true, Computed: true, @@ -88,13 +95,15 @@ func resourceScalrWebhook() *schema.Resource { }, "secret_key": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Sensitive: true, + Description: "Secret key to sign the webhook payload.", + Type: schema.TypeString, + Optional: true, + Computed: true, + Sensitive: true, }, "timeout": { + Description: "Endpoint timeout (in seconds).", Type: schema.TypeInt, Optional: true, Default: 15, @@ -102,6 +111,7 @@ func resourceScalrWebhook() *schema.Resource { }, "max_attempts": { + Description: "Max delivery attempts of the payload.", Type: schema.TypeInt, Optional: true, Default: 3, @@ -109,16 +119,19 @@ func resourceScalrWebhook() *schema.Resource { }, "header": { - Type: schema.TypeSet, - Optional: true, + Description: "Additional headers to set in the webhook request.", + Type: schema.TypeSet, + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { + Description: "The name of the header.", Type: schema.TypeString, Required: true, ValidateFunc: validation.StringIsNotWhiteSpace, }, "value": { + Description: "The value of the header.", Type: schema.TypeString, Required: true, ValidateFunc: validation.StringIsNotWhiteSpace, @@ -128,6 +141,7 @@ func resourceScalrWebhook() *schema.Resource { }, "account_id": { + Description: "ID of the account, in the format `acc-`.", Type: schema.TypeString, Optional: true, Computed: true, @@ -136,15 +150,17 @@ func resourceScalrWebhook() *schema.Resource { }, "workspace_id": { - Type: schema.TypeString, - Optional: true, - Deprecated: "The attribute `workspace_id` is deprecated.", + Description: "ID of the workspace, in the format `ws-`.", + Type: schema.TypeString, + Optional: true, + Deprecated: "The attribute `workspace_id` is deprecated.", }, "environment_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Optional: true, + Computed: true, Deprecated: "The attribute `environment_id` is deprecated. The webhook is created on the" + " account level and the environments to which it is exposed" + " are controlled by the `environments` attribute.", @@ -152,10 +168,11 @@ func resourceScalrWebhook() *schema.Resource { }, "environments": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The list of environment identifiers that the webhook is shared to. Use `[\"*\"]` to share with all environments.", + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_workspace.go b/scalr/resource_scalr_workspace.go index c4e1b473..81022da3 100644 --- a/scalr/resource_scalr_workspace.go +++ b/scalr/resource_scalr_workspace.go @@ -15,6 +15,7 @@ import ( func resourceScalrWorkspace() *schema.Resource { return &schema.Resource{ + Description: "Manage the state of workspaces in Scalr. Create, update and destroy.", CreateContext: resourceScalrWorkspaceCreate, ReadContext: resourceScalrWorkspaceRead, UpdateContext: resourceScalrWorkspaceUpdate, @@ -49,53 +50,62 @@ func resourceScalrWorkspace() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Description: "Name of the workspace.", + Type: schema.TypeString, + Required: true, }, "environment_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Description: "ID of the environment, in the format `env-`.", + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "vcs_provider_id": { + Description: "ID of VCS provider - required if vcs-repo present and vice versa, in the format `vcs-`.", Type: schema.TypeString, Optional: true, ConflictsWith: []string{"module_version_id"}, RequiredWith: []string{"vcs_repo"}, }, "module_version_id": { + Description: "The identifier of a module version in the format `modver-`. This attribute conflicts with `vcs_provider_id` and `vcs_repo` attributes.", Type: schema.TypeString, Optional: true, ConflictsWith: []string{"vcs_provider_id", "vcs_repo"}, }, "agent_pool_id": { - Type: schema.TypeString, - Optional: true, + Description: "The identifier of an agent pool in the format `apool-`.", + Type: schema.TypeString, + Optional: true, }, "auto_apply": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure if `terraform apply` should automatically run when `terraform plan` ends without error. Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "force_latest_run": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Set (true/false) to configure if latest new run will be automatically raised in priority. Default `false`.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, "deletion_protection_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, + Description: "Indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed. Default `true`.", + Type: schema.TypeBool, + Optional: true, + Default: true, }, "var_files": { - Type: schema.TypeList, - Optional: true, + Description: "A list of paths to the `.tfvars` file(s) to be used as part of the workspace configuration.", + Type: schema.TypeList, + Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, @@ -103,16 +113,18 @@ func resourceScalrWorkspace() *schema.Resource { }, "operations": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Deprecated: "The attribute `operations` is deprecated. Use `execution_mode` instead", + Description: "Set (true/false) to configure workspace remote execution. When `false` workspace is only used to store state. Defaults to `true`.", + Type: schema.TypeBool, + Optional: true, + Computed: true, + Deprecated: "The attribute `operations` is deprecated. Use `execution_mode` instead", }, "execution_mode": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "Which execution mode to use. Valid values are `remote` and `local`. When set to `local`, the workspace will be used for state storage only. Defaults to `remote` (not set, backend default is used).", + Type: schema.TypeString, + Optional: true, + Computed: true, ValidateFunc: validation.StringInSlice( []string{ string(scalr.WorkspaceExecutionModeRemote), @@ -123,61 +135,74 @@ func resourceScalrWorkspace() *schema.Resource { }, "terraform_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Description: "The version of Terraform to use for this workspace. Defaults to the latest available version.", + Type: schema.TypeString, + Optional: true, + Computed: true, }, "working_directory": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "A relative path that Terraform will be run in. Defaults to the root of the repository `\"\"`.", + Type: schema.TypeString, + Optional: true, + Default: "", }, "hooks": { - Type: schema.TypeList, - Optional: true, + Description: "Settings for the workspaces custom hooks.", + Type: schema.TypeList, + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "pre_init": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Action that will be called before the init phase.", + Type: schema.TypeString, + Optional: true, + Default: "", }, "pre_plan": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Action that will be called before the plan phase.", + Type: schema.TypeString, + Optional: true, + Default: "", }, "post_plan": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Action that will be called after plan phase.", + Type: schema.TypeString, + Optional: true, + Default: "", }, "pre_apply": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Action that will be called before apply phase.", + Type: schema.TypeString, + Optional: true, + Default: "", }, "post_apply": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Action that will be called after apply phase.", + Type: schema.TypeString, + Optional: true, + Default: "", }, }, }, }, "has_resources": { - Type: schema.TypeBool, - Computed: true, + Description: "The presence of active terraform resources in the current state version.", + Type: schema.TypeBool, + Computed: true, }, "auto_queue_runs": { + Description: "Indicates if runs have to be queued automatically when a new configuration version is uploaded. Supported values are `skip_first`, `always`, `never`:" + + "\n * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior." + + "\n * `always` - runs will be triggered automatically on every upload of the configuration version." + + "\n * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered.", Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringInSlice( @@ -192,6 +217,7 @@ func resourceScalrWorkspace() *schema.Resource { }, "vcs_repo": { + Description: "Settings for the workspace's VCS repository.", Type: schema.TypeList, Optional: true, MinItems: 1, @@ -201,87 +227,102 @@ func resourceScalrWorkspace() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "identifier": { - Type: schema.TypeString, - Required: true, + Description: "A reference to your VCS repository in the format `:org/:repo`, it refers to the organization and repository in your VCS provider.", + Type: schema.TypeString, + Required: true, }, "branch": { - Type: schema.TypeString, - Optional: true, + Description: "The repository branch where Terraform will be run from. If omitted, the repository default branch will be used.", + Type: schema.TypeString, + Optional: true, }, "path": { - Type: schema.TypeString, - Default: "", - Optional: true, - Deprecated: "The attribute `vcs-repo.path` is deprecated. Use working-directory and trigger-prefixes instead.", + Description: "The repository subdirectory that Terraform will execute from. If omitted or submitted as an empty string, this defaults to the repository's root.", + Type: schema.TypeString, + Default: "", + Optional: true, + Deprecated: "The attribute `vcs-repo.path` is deprecated. Use working-directory and trigger-prefixes instead.", }, "trigger_prefixes": { - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - Optional: true, - Computed: true, + Description: "List of paths (relative to `path`), whose changes will trigger a run for the workspace using this binding when the CV is created. If omitted or submitted as an empty list, any change in `path` will trigger a new run.", + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Optional: true, + Computed: true, }, "dry_runs_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, + Description: "Set (true/false) to configure the VCS driven dry runs should run when pull request to configuration versions branch created. Default `true`.", + Type: schema.TypeBool, + Optional: true, + Default: true, }, "ingress_submodules": { - Type: schema.TypeBool, - Optional: true, - Default: false, + Description: "Designates whether to clone git submodules of the VCS repository.", + Type: schema.TypeBool, + Optional: true, + Default: false, }, }, }, }, "created_by": { - Type: schema.TypeList, - Computed: true, + Description: "Details of the user that created the workspace.", + Type: schema.TypeList, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "username": { - Type: schema.TypeString, - Computed: true, + Description: "Username of creator.", + Type: schema.TypeString, + Computed: true, }, "email": { - Type: schema.TypeString, - Computed: true, + Description: "Email address of creator.", + Type: schema.TypeString, + Computed: true, }, "full_name": { - Type: schema.TypeString, - Computed: true, + Description: "Full name of creator.", + Type: schema.TypeString, + Computed: true, }, }, }, }, "run_operation_timeout": { - Type: schema.TypeInt, - Optional: true, + Description: "The number of minutes run operation can be executed before termination. Defaults to `0` (not set, backend default is used).", + Type: schema.TypeInt, + Optional: true, }, "provider_configuration": { - Type: schema.TypeSet, - Optional: true, + Description: "Provider configurations used in workspace runs.", + Type: schema.TypeSet, + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Required: true, + Description: "The identifier of provider configuration.", + Type: schema.TypeString, + Required: true, }, "alias": { - Type: schema.TypeString, - Optional: true, + Description: "The alias of provider configuration.", + Type: schema.TypeString, + Optional: true, }, }, }, }, "tag_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of tag IDs associated with the workspace.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, }, } diff --git a/scalr/resource_scalr_workspace_run_schedule.go b/scalr/resource_scalr_workspace_run_schedule.go index 5286e87a..e80e2ace 100644 --- a/scalr/resource_scalr_workspace_run_schedule.go +++ b/scalr/resource_scalr_workspace_run_schedule.go @@ -12,6 +12,7 @@ import ( func resourceScalrWorkspaceRunSchedule() *schema.Resource { return &schema.Resource{ + Description: "Allows workspace admins to automate the configuration of recurring runs for a workspace.", CreateContext: resourceScalrWorkspaceRunScheduleCreate, ReadContext: resourceScalrWorkspaceRunScheduleRead, UpdateContext: resourceScalrWorkspaceRunScheduleUpdate, @@ -21,19 +22,27 @@ func resourceScalrWorkspaceRunSchedule() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "id": { + Description: "The ID of this resource. Equals to the ID of the workspace.", + Type: schema.TypeString, + Computed: true, + }, "workspace_id": { - Type: schema.TypeString, - Required: true, + Description: "ID of the workspace, in the format `ws-`.", + Type: schema.TypeString, + Required: true, }, "apply_schedule": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Cron expression for when apply run should be created.", + Type: schema.TypeString, + Optional: true, + Default: "", }, "destroy_schedule": { - Type: schema.TypeString, - Optional: true, - Default: "", + Description: "Cron expression for when destroy run should be created.", + Type: schema.TypeString, + Optional: true, + Default: "", }, }, } diff --git a/templates/data-sources.md.tmpl b/templates/data-sources.md.tmpl new file mode 100644 index 00000000..4755ca35 --- /dev/null +++ b/templates/data-sources.md.tmpl @@ -0,0 +1,18 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_{{.Name}}" +parentDocSlug: "provider_datasources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/data-sources/access_policy.md.tmpl b/templates/data-sources/access_policy.md.tmpl new file mode 100644 index 00000000..e850db07 --- /dev/null +++ b/templates/data-sources/access_policy.md.tmpl @@ -0,0 +1,47 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_{{.Name}}" +parentDocSlug: "provider_datasources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + + +## Schema + +### Required + +- `id` (String) The access policy ID. + +### Read-Only + +- `is_system` (Boolean) +- `role_ids` (List of String) The list of the role IDs. +- `scope` (List of Object) Defines the scope where access policy is applied. (see [below for nested schema](#nestedatt--scope)) +- `subject` (List of Object) Defines the subject of the access policy. (see [below for nested schema](#nestedatt--subject)) + + +### Nested Schema for `scope` + +Read-Only: + +- `id` (String) The scope ID, `acc-` for account, `env-` for environment, `ws-` for workspace. +- `type` (String) The scope identity type, is one of `account`, `environment`, or `workspace`. + + + +### Nested Schema for `subject` + +Read-Only: + +- `id` (String) The subject ID, `user-` for user, `team-` for team, `sa-` for service account. +- `type` (String) The subject type, is one of `user`, `team`, or `service_account`. diff --git a/templates/data-sources/endpoint.md.tmpl b/templates/data-sources/endpoint.md.tmpl new file mode 100644 index 00000000..63d22ffa --- /dev/null +++ b/templates/data-sources/endpoint.md.tmpl @@ -0,0 +1,20 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_{{.Name}}" +parentDocSlug: "provider_datasources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +> 🚧 This datasource is deprecated and will be removed in the next major version. + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/data-sources/policy_group.md.tmpl b/templates/data-sources/policy_group.md.tmpl new file mode 100644 index 00000000..c2894caa --- /dev/null +++ b/templates/data-sources/policy_group.md.tmpl @@ -0,0 +1,54 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_{{.Name}}" +parentDocSlug: "provider_datasources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + + +## Schema + +### Optional + +- `account_id` (String) The identifier of the Scalr account. +- `id` (String) The identifier of a policy group. +- `name` (String) The name of a policy group. + +### Read-Only + +- `environments` (List of String) A list of the environments the policy group is linked to. +- `error_message` (String) An error details if Scalr failed to process the policy group. +- `opa_version` (String) The version of the Open Policy Agent that the policy group is using. +- `policies` (List of Object) A list of the OPA policies the policy group verifies each run. (see [below for nested schema](#nestedatt--policies)) +- `status` (String) A system status of the policy group. +- `vcs_provider_id` (String) The VCS provider identifier for the repository where the policy group resides. In the format `vcs-`. +- `vcs_repo` (List of Object) Contains VCS-related meta-data for the policy group. (see [below for nested schema](#nestedatt--vcs_repo)) + + +### Nested Schema for `policies` + +Read-Only: + +- `enabled` (Boolean) If set to `false`, the policy will not be verified on a run. +- `enforced_level` (String) An enforcement level of a policy. +- `name` (String) A name of a policy. + + + +### Nested Schema for `vcs_repo` + +Read-Only: + +- `branch` (String) A branch of a repository the policy group is associated with. +- `identifier` (String) A reference to the VCS repository in the format `:org/:repo`, it stands for the organization and repository. +- `path` (String) A subdirectory of a VCS repository where OPA policies are stored. diff --git a/templates/data-sources/variables.md.tmpl b/templates/data-sources/variables.md.tmpl new file mode 100644 index 00000000..3d3c832e --- /dev/null +++ b/templates/data-sources/variables.md.tmpl @@ -0,0 +1,49 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_{{.Name}}" +parentDocSlug: "provider_datasources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + + +## Schema + +### Optional + +- `account_id` (String) ID of the account, in the format `acc-`. +- `category` (String) The category of a Scalr variable. +- `environment_ids` (Set of String) A list of identifiers of the Scalr environments, in the format `env-`. Used to shrink the variable's scope in case the variable name exists in multiple environments. +- `keys` (Set of String) A list of keys to be used in the query used in a Scalr variable name filter. +- `workspace_ids` (Set of String) A list of identifiers of the Scalr workspace, in the format `ws-`. Used to shrink the variable's scope in case the variable name exists on multiple workspaces. + +### Read-Only + +- `id` (String) The ID of this resource. +- `variables` (Set of Object) The list of Scalr variables with all attributes. (see [below for nested schema](#nestedatt--variables)) + + +### Nested Schema for `variables` + +Read-Only: + +- `account_id` (String) The account that owns the variable, specified as an ID, in the format `acc-`. +- `category` (String) Indicates if this is a Terraform or shell variable. +- `description` (String) Variable verbose description. +- `environment_id` (String) The environment that owns the variable, specified as an ID, in the format `env-`. +- `final` (Boolean) If the variable is configured as final. Indicates whether the variable can be overridden on a lower scope down the Scalr organizational model. +- `hcl` (Boolean) If the variable is configured as a string of HCL code. +- `id` (String) ID of the variable. +- `key` (String) Key of the variable. +- `sensitive` (Boolean) If the variable is configured as sensitive. +- `value` (String) Variable value if it is not sensitive. +- `workspace_id` (String) The workspace that owns the variable, specified as an ID, in the format `ws-`. diff --git a/templates/data-sources/workspace.md.tmpl b/templates/data-sources/workspace.md.tmpl new file mode 100644 index 00000000..effc4dfa --- /dev/null +++ b/templates/data-sources/workspace.md.tmpl @@ -0,0 +1,85 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_datasource_{{.Name}}" +parentDocSlug: "provider_datasources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + + +## Schema + +### Required + +- `environment_id` (String) ID of the environment, in the format `env-`. + +### Optional + +- `id` (String) ID of the workspace. +- `name` (String) Name of the workspace. + +### Read-Only + +- `agent_pool_id` (String) The identifier of an agent pool in the format `apool-`. +- `auto_apply` (Boolean) Boolean indicates if `terraform apply` will be automatically run when `terraform plan` ends without error. +- `auto_queue_runs` (String) Indicates if runs have to be queued automatically when a new configuration version is uploaded. + + Supported values are `skip_first`, `always`, `never`: + + * `skip_first` - after the very first configuration version is uploaded into the workspace the run will not be triggered. But the following configurations will do. This is the default behavior. + * `always` - runs will be triggered automatically on every upload of the configuration version. + * `never` - configuration versions are uploaded into the workspace, but runs will not be triggered. +- `created_by` (List of Object) Details of the user that created the workspace. (see [below for nested schema](#nestedatt--created_by)) +- `deletion_protection_enabled` (Boolean) Boolean, indicates if the workspace has the protection from an accidental state lost. If enabled and the workspace has resource, the deletion will not be allowed. +- `execution_mode` (String) Execution mode of the workspace. +- `force_latest_run` (Boolean) Boolean indicates if latest new run will be automatically raised in priority. +- `has_resources` (Boolean) The presence of active terraform resources in the current state version. +- `hooks` (List of Object) List of custom hooks in a workspace. (see [below for nested schema](#nestedatt--hooks)) +- `module_version_id` (String) The identifier of a module version in the format `modver-`. +- `operations` (Boolean) Boolean indicates if the workspace is being used for remote execution. +- `tag_ids` (List of String) List of tag IDs associated with the workspace. +- `terraform_version` (String) The version of Terraform used for this workspace. +- `vcs_provider_id` (String) The identifier of a VCS provider in the format `vcs-`. +- `vcs_repo` (List of Object) If a workspace is linked to a VCS repository this block shows the details, otherwise `{}` (see [below for nested schema](#nestedatt--vcs_repo)) +- `working_directory` (String) A relative path that Terraform will execute within. + + +### Nested Schema for `created_by` + +Read-Only: + +- `email` (String) Email address of creator. +- `full_name` (String) Full name of creator. +- `username` (String) Username of creator. + + + +### Nested Schema for `hooks` + +Read-Only: + +- `post_apply` (String) Script or action configured to call after apply phase. +- `post_plan` (String) Script or action configured to call after plan phase. +- `pre_apply` (String) Script or action configured to call before apply phase. +- `pre_init` (String) Script or action configured to call before init phase. +- `pre_plan` (String) Script or action configured to call before plan phase. + + + +### Nested Schema for `vcs_repo` + +Read-Only: + +- `dry_runs_enabled` (Boolean) Boolean indicates the VCS-driven dry runs should run when the pull request to the configuration versions branch is created. +- `identifier` (String) The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider. +- `ingress_submodules` (Boolean) Designates whether to clone git submodules of the VCS repository. +- `path` (String) Path within the repo, if any. diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl new file mode 100644 index 00000000..e9059f92 --- /dev/null +++ b/templates/index.md.tmpl @@ -0,0 +1,51 @@ +--- +title: "Overview" +categorySlug: "scalr-terraform-provider" +slug: "provider_overview" +order: 0 +hidden: false +--- +The Scalr Terraform provider can be used to manage objects in Scalr with Terraform. + +Using the Scalr Terraform provider is a best practice as you scale your Terraform and Scalr operations. It is not required, but many customers have a Scalr admin environment and workspace(s), which use the provider to manage all other objects in Scalr. + +Some customers have built a Scalr "vending" machine, which continues the automation already done with cloud vending machines. The goal is to vend out Scalr environments and/or workspaces as teams are onboarded with objects preconfigured to allow for a seamless onboarding experience. + +## Usage + +To use the Scalr provider, add the following code block to your code: + +{{tffile "examples/provider/usage.tf" }} + +The latest information on the provider version can be found at https://registry.scalr.io. +The GPG key information for the provider can be found at https://registry.scalr.io/scalr_pubkey.asc. +The fingerprint for the provider is `1EF68C8041FC80714FF7A4017F685A20F41004C4`. + +## Authentication + +To authenticate to the provider, you must obtain a Scalr API token and call the provider with it: + +{{tffile "examples/provider/auth.tf" }} + +If authentication is being done with shell variables, the following variables can be used: + +```shell +export SCALR_HOSTNAME=".scalr.io" +export SCALR_TOKEN="xxxxxxxxxxxxxxxxxx" +``` + +If you have tokens stored in files locally, the `~/.terraform.d/credentials.tfrc.json` file will take precedence over those in `~/.terraformrc`. + +## Service Account Authentication + +As mentioned, a best practice is to use the Scalr Terraform provider to manage objects within Scalr. + +If you are using Scalr to execute the Terraform runs that call the Scalr provider, you must override a default token set for each run. The default token has minimal permissions to allow for the run execution, which means the run will fail if you don't set the `SCALR_TOKEN` variable in the workspace. It is recommended to use a [service account](/docs/identity-and-access-management#service-accounts) for the token. + +![SCALR_TOKEN Variable](https://files.readme.io/2a1d8e3-Screen_Shot_2022-11-28_at_12.19.04_PM.png) + +## Example - Scalr Ignite + +Not sure where to get started? Take a look at the Ignite repo, which will deploy a sample organizational structure in Scalr through the Terraform provider. This is meant to give you a starting point which you can build upon and is also a great example of how you can use YAML with the provider if needed: https://github.com/sierra-cedar/scalr-ignite. + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources.md.tmpl b/templates/resources.md.tmpl new file mode 100644 index 00000000..9e373d10 --- /dev/null +++ b/templates/resources.md.tmpl @@ -0,0 +1,27 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_{{.Name}}" +parentDocSlug: "provider_resources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + +{{ .SchemaMarkdown | trimspace }} + +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile}} +{{- end }} diff --git a/templates/resources/endpoint.md.tmpl b/templates/resources/endpoint.md.tmpl new file mode 100644 index 00000000..b629ec77 --- /dev/null +++ b/templates/resources/endpoint.md.tmpl @@ -0,0 +1,35 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_{{.Name}}" +parentDocSlug: "provider_resources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +> 🚧 This resource is deprecated and will be removed in the next major version. + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile }} +{{- end }} + +{{ .SchemaMarkdown | trimspace }} + +## Useful snippets + +The secret key can be generated using the `random_string` resource. + +{{tffile "examples/resources/scalr_endpoint/secret-key.tf" }} + +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile}} +{{- end }} diff --git a/templates/resources/provider_configuration.md.tmpl b/templates/resources/provider_configuration.md.tmpl new file mode 100644 index 00000000..36e337c0 --- /dev/null +++ b/templates/resources/provider_configuration.md.tmpl @@ -0,0 +1,51 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_{{.Name}}" +parentDocSlug: "provider_resources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +## Example Usage + +### Scalr provider + +{{tffile "examples/resources/scalr_provider_configuration/scalr.tf" }} + +### AWS provider + +{{tffile "examples/resources/scalr_provider_configuration/aws.tf" }} + +{{tffile "examples/resources/scalr_provider_configuration/aws-oidc.tf" }} + +To get into more advanced AWS usage please refer to the official [AWS module](https://github.com/Scalr/terraform-scalr-provider-configuration-aws). + +### AzureRM provider + +{{tffile "examples/resources/scalr_provider_configuration/azurerm.tf" }} + +{{tffile "examples/resources/scalr_provider_configuration/azurerm-oidc.tf" }} + +### Google provider + +{{tffile "examples/resources/scalr_provider_configuration/google.tf" }} + +{{tffile "examples/resources/scalr_provider_configuration/google-oidc.tf" }} + +### Custom providers + +{{tffile "examples/resources/scalr_provider_configuration/custom.tf" }} + +{{ .SchemaMarkdown | trimspace }} + +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile}} +{{- end }} diff --git a/templates/resources/workspace.md.tmpl b/templates/resources/workspace.md.tmpl new file mode 100644 index 00000000..36f32f20 --- /dev/null +++ b/templates/resources/workspace.md.tmpl @@ -0,0 +1,39 @@ +--- +title: "{{.Name}}" +categorySlug: "scalr-terraform-provider" +slug: "provider_resource_{{.Name}}" +parentDocSlug: "provider_resources" +hidden: false +--- +## {{.Type}} Overview + +{{ .Description | trimspace }} + +## Example Usage + +### VCS-driven + +{{tffile "examples/resources/scalr_workspace/vcs.tf" }} + +### Module-driven + +{{tffile "examples/resources/scalr_workspace/module.tf" }} + +### CLI-driven + +{{tffile "examples/resources/scalr_workspace/cli.tf" }} + +### Create tagged workspaces + +{{tffile "examples/resources/scalr_workspace/tags.tf" }} + +{{ .SchemaMarkdown | trimspace }} + +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile}} +{{- end }} diff --git a/tools/page_order.go b/tools/page_order.go new file mode 100644 index 00000000..97640d2e --- /dev/null +++ b/tools/page_order.go @@ -0,0 +1,78 @@ +//go:build tools + +package main + +import ( + "flag" + "fmt" + "log" + "os" + "path/filepath" + "strings" +) + +func main() { + var dir string + flag.StringVar(&dir, "dir", "", "The directory to search for the *.md files.") + flag.Parse() + + if dir == "" { + log.Fatal("Directory not specified.") + } + + fmt.Printf("--- Ordering the documentation files in %q:\n", dir) + + pattern := strings.TrimSuffix(dir, "/") + "/*.md" + files, err := filepath.Glob(pattern) + if err != nil { + log.Fatal(err) + } + + order := 1 + for _, f := range files { + fmt.Printf("> Processing %q, order = %d...\n", filepath.Base(f), order) + + bytes, err := os.ReadFile(f) + if err != nil { + log.Fatalln(err) + } + + lines := strings.Split(string(bytes), "\n") + frontMatterFound := false + + for j, l := range lines { + if l == "---" { + if frontMatterFound { + // This is the closing Front Matter delimiter. + // No `order: ` records were found, + // so we insert a new one. + lines = append(lines[:j+1], lines[j:]...) + lines[j] = fmt.Sprintf("order: %d", order) + order++ + fmt.Println(" * Added order record.") + break + } else { + frontMatterFound = true + continue + } + } + if frontMatterFound && strings.HasPrefix(l, "order:") { + lines[j] = fmt.Sprintf("order: %d", order) + order++ + fmt.Println(" * Updated order record.") + break + } + } + if frontMatterFound { + err = os.WriteFile(f, []byte(strings.Join(lines, "\n")), 0644) + if err != nil { + log.Fatalln(err) + } + fmt.Println(" * File saved.") + } else { + fmt.Println(" ? No Front Matter block detected, skipping.") + } + } + + fmt.Println("--- Done.") +} diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 00000000..d72c970c --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,7 @@ +//go:build tools + +package tools + +import ( + _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs" +)