Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCALRCORE-28573 Provider > Prepare docs for terraform registry #283

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ slug: "provider_overview"
order: 0
hidden: false
---
# Scalr Provider

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.
Expand Down Expand Up @@ -54,7 +56,7 @@ If you have tokens stored in files locally, the `~/.terraform.d/credentials.tfrc

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.
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](https://docs.scalr.io/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)

Expand All @@ -68,4 +70,4 @@ Not sure where to get started? Take a look at the Ignite repo, which will deploy
### Optional

- `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.
- `token` (String) The token used to authenticate with Scalr. Can be overridden by setting the `SCALR_TOKEN` environment variable. See [Scalr provider configuration](https://docs.scalr.io/docs/scalr) for information on generating a token.
2 changes: 1 addition & 1 deletion docs/resources/provider_configuration_default.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ order: 12

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.
**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_resource_scalr_provider_configuration) and attribute `environments` to learn more.

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion scalr/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Provider() *schema.Provider {
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)" +
" See [Scalr provider configuration](https://docs.scalr.io/docs/scalr)" +
" for information on generating a token.",
DefaultFunc: schema.EnvDefaultFunc("SCALR_TOKEN", nil),
},
Expand Down
2 changes: 1 addition & 1 deletion scalr/resource_scalr_provider_configuration_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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)" +
" See the definition of the resource [`scalr_provider_configuration`](provider_resource_scalr_provider_configuration)" +
" and attribute `environments` to learn more.",
CreateContext: resourceScalrProviderConfigurationDefaultCreate,
ReadContext: resourceScalrProviderConfigurationDefaultRead,
Expand Down
4 changes: 3 additions & 1 deletion templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ slug: "provider_overview"
order: 0
hidden: false
---
# {{.ProviderShortName | title}} Provider

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.
Expand Down Expand Up @@ -40,7 +42,7 @@ If you have tokens stored in files locally, the `~/.terraform.d/credentials.tfrc

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.
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](https://docs.scalr.io/docs/identity-and-access-management#service-accounts) for the token.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: First sentence, not liking it. "If your Scalr workspace configuration uses Scalr provider, you must override the token set by default for each run" or something like that.


![SCALR_TOKEN Variable](https://files.readme.io/2a1d8e3-Screen_Shot_2022-11-28_at_12.19.04_PM.png)

Expand Down
Loading