Skip to content

Commit

Permalink
SCALRCORE-32726 add attrs to data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
DayS1eeper committed Dec 18, 2024
1 parent db36e4c commit f5eb172
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `data.scalr_environments`: changed type of `ids` attribute from TypeList to TypeSet ([373](https://github.com/Scalr/terraform-provider-scalr/pull/373))

- `scalr_workspace`: new attribute `terragrunt_version` ([#378](https://github.com/Scalr/terraform-provider-scalr/pull/378))
- `scalr_workspace`: new attribute `terragrunt_use_run_all` ([#378](https://github.com/Scalr/terraform-provider-scalr/pull/378))
- `scalr_environment`: new attribute `remote_backend` ([#378](https://github.com/Scalr/terraform-provider-scalr/pull/378))
- `scalr_workspace` and `data.scalr_workspace`: new attributes `terragrunt_version` and `terragrunt_use_run_all` ([#378](https://github.com/Scalr/terraform-provider-scalr/pull/378))
- `scalr_environment` and `data.scalr_environment`: new attribute `remote_backend` ([#378](https://github.com/Scalr/terraform-provider-scalr/pull/378))

## [2.2.0] - 2024-11-22

Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data "scalr_environment" "example2" {
- `created_by` (List of Object) Details of the user that created the environment. (see [below for nested schema](#nestedatt--created_by))
- `default_provider_configurations` (List 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-<RANDOM STRING>`.
- `remote_backend` (Boolean) If Scalr exports the remote backend configuration and state storage for your infrastructure management. Disabling this feature will also prevent the ability to perform state locking, which ensures that concurrent operations do not conflict. Additionally, it will disable the capability to initiate CLI-driven runs through Scalr.
- `status` (String) The status of an environment.
- `tag_ids` (List of String) List of tag IDs associated with the environment.

Expand Down
6 changes: 6 additions & 0 deletions internal/provider/data_source_scalr_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ func dataSourceScalrEnvironment() *schema.Resource {
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"remote_backend": {
Description: "If Scalr exports the remote backend configuration and state storage for your infrastructure management. Disabling this feature will also prevent the ability to perform state locking, which ensures that concurrent operations do not conflict. Additionally, it will disable the capability to initiate CLI-driven runs through Scalr.",
Type: schema.TypeBool,
Computed: true,
},
}}
}

Expand Down Expand Up @@ -131,6 +136,7 @@ func dataSourceEnvironmentRead(ctx context.Context, d *schema.ResourceData, meta
_ = d.Set("name", environment.Name)
_ = d.Set("cost_estimation_enabled", environment.CostEstimationEnabled)
_ = d.Set("status", environment.Status)
_ = d.Set("remote_backend", environment.RemoteBackend)

var createdBy []interface{}
if environment.CreatedBy != nil {
Expand Down
13 changes: 12 additions & 1 deletion internal/provider/data_source_scalr_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,16 @@ func dataSourceScalrWorkspace() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},

"terragrunt_version": {
Description: "The version of Terragrunt the workspace performs runs on.",
Type: schema.TypeString,
Computed: true,
},
"terragrunt_use_run_all": {
Description: "Indicates whether the workspace uses `terragrunt run-all`.",
Type: schema.TypeBool,
Computed: true,
},
"iac_platform": {
Description: "The IaC platform used for this workspace.",
Type: schema.TypeString,
Expand Down Expand Up @@ -275,6 +284,8 @@ func dataSourceScalrWorkspaceRead(ctx context.Context, d *schema.ResourceData, m
_ = d.Set("operations", workspace.Operations)
_ = d.Set("execution_mode", workspace.ExecutionMode)
_ = d.Set("terraform_version", workspace.TerraformVersion)
_ = d.Set("terragrunt_version", workspace.TerragruntVersion)
_ = d.Set("terragrunt_use_run_all", workspace.TerragruntUseRunAll)
_ = d.Set("iac_platform", workspace.IaCPlatform)
_ = d.Set("type", workspace.EnvironmentType)
_ = d.Set("working_directory", workspace.WorkingDirectory)
Expand Down

0 comments on commit f5eb172

Please sign in to comment.