diff --git a/CHANGELOG.md b/CHANGELOG.md index 001d6342..b81d0a5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `scalr_workspace`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) +- `data.scalr_workspace`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) - `scalr_workspace`: added new attribute `execution-mode` ([#157](https://github.com/Scalr/terraform-provider-scalr/pull/157)) +- `data.scalr_workspace`: added new attribute `execution-mode` ([#157](https://github.com/Scalr/terraform-provider-scalr/pull/157)) ### Deprecated diff --git a/docs/data-sources/scalr_workspace.md b/docs/data-sources/scalr_workspace.md index 4146e752..1029f676 100644 --- a/docs/data-sources/scalr_workspace.md +++ b/docs/data-sources/scalr_workspace.md @@ -46,7 +46,7 @@ All arguments plus: The `hooks` block supports: - * `pre_init` - Script or action configured to call before init phase + * `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 @@ -57,9 +57,10 @@ 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 pull request to configuration versions branch 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. \ No newline at end of file +* `full_name` - Full name of creator. diff --git a/docs/resources/scalr_workspace.md b/docs/resources/scalr_workspace.md index 735acf7a..65772753 100644 --- a/docs/resources/scalr_workspace.md +++ b/docs/resources/scalr_workspace.md @@ -118,6 +118,7 @@ resource "scalr_workspace" "cli-driven" { * `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. diff --git a/scalr/data_source_workspace.go b/scalr/data_source_workspace.go index 5e918130..8ef5b6a4 100644 --- a/scalr/data_source_workspace.go +++ b/scalr/data_source_workspace.go @@ -116,6 +116,10 @@ func dataSourceScalrWorkspace() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Computed: true, + }, }, }, }, @@ -189,9 +193,10 @@ func dataSourceScalrWorkspaceRead(d *schema.ResourceData, meta interface{}) erro var vcsRepo []interface{} if workspace.VCSRepo != nil { vcsConfig := map[string]interface{}{ - "identifier": workspace.VCSRepo.Identifier, - "path": workspace.VCSRepo.Path, - "dry_runs_enabled": workspace.VCSRepo.DryRunsEnabled, + "identifier": workspace.VCSRepo.Identifier, + "path": workspace.VCSRepo.Path, + "dry_runs_enabled": workspace.VCSRepo.DryRunsEnabled, + "ingress_submodules": workspace.VCSRepo.IngressSubmodules, } vcsRepo = append(vcsRepo, vcsConfig) } diff --git a/scalr/resource_scalr_workspace.go b/scalr/resource_scalr_workspace.go index 8d330f00..e5f4e7f4 100644 --- a/scalr/resource_scalr_workspace.go +++ b/scalr/resource_scalr_workspace.go @@ -197,6 +197,11 @@ func resourceScalrWorkspace() *schema.Resource { Optional: true, Default: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, }, @@ -324,10 +329,11 @@ func resourceScalrWorkspaceCreate(d *schema.ResourceData, meta interface{}) erro } options.VCSRepo = &scalr.WorkspaceVCSRepoOptions{ - Identifier: scalr.String(vcsRepo["identifier"].(string)), - Path: scalr.String(vcsRepo["path"].(string)), - TriggerPrefixes: &triggerPrefixes, - DryRunsEnabled: scalr.Bool(vcsRepo["dry_runs_enabled"].(bool)), + Identifier: scalr.String(vcsRepo["identifier"].(string)), + Path: scalr.String(vcsRepo["path"].(string)), + TriggerPrefixes: &triggerPrefixes, + DryRunsEnabled: scalr.Bool(vcsRepo["dry_runs_enabled"].(bool)), + IngressSubmodules: scalr.Bool(vcsRepo["ingress_submodules"].(bool)), } // Only set the branch if one is configured. @@ -445,11 +451,12 @@ func resourceScalrWorkspaceRead(d *schema.ResourceData, meta interface{}) error var vcsRepo []interface{} if workspace.VCSRepo != nil { vcsRepo = append(vcsRepo, map[string]interface{}{ - "branch": workspace.VCSRepo.Branch, - "identifier": workspace.VCSRepo.Identifier, - "path": workspace.VCSRepo.Path, - "trigger_prefixes": workspace.VCSRepo.TriggerPrefixes, - "dry_runs_enabled": workspace.VCSRepo.DryRunsEnabled, + "branch": workspace.VCSRepo.Branch, + "identifier": workspace.VCSRepo.Identifier, + "path": workspace.VCSRepo.Path, + "trigger_prefixes": workspace.VCSRepo.TriggerPrefixes, + "dry_runs_enabled": workspace.VCSRepo.DryRunsEnabled, + "ingress_submodules": workspace.VCSRepo.IngressSubmodules, }) } d.Set("vcs_repo", vcsRepo) @@ -556,11 +563,12 @@ func resourceScalrWorkspaceUpdate(d *schema.ResourceData, meta interface{}) erro } options.VCSRepo = &scalr.WorkspaceVCSRepoOptions{ - Identifier: scalr.String(vcsRepo["identifier"].(string)), - Branch: scalr.String(vcsRepo["branch"].(string)), - Path: scalr.String(vcsRepo["path"].(string)), - TriggerPrefixes: &triggerPrefixes, - DryRunsEnabled: scalr.Bool(vcsRepo["dry_runs_enabled"].(bool)), + Identifier: scalr.String(vcsRepo["identifier"].(string)), + Branch: scalr.String(vcsRepo["branch"].(string)), + Path: scalr.String(vcsRepo["path"].(string)), + TriggerPrefixes: &triggerPrefixes, + DryRunsEnabled: scalr.Bool(vcsRepo["dry_runs_enabled"].(bool)), + IngressSubmodules: scalr.Bool(vcsRepo["ingress_submodules"].(bool)), } }