From 0e82a62a2c39a2f3027902b30b43f4a783c310aa Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Mon, 4 Jul 2022 11:08:48 +0300 Subject: [PATCH 01/14] SCALRCORE-17117 Add vcs_repo.ingress_submodules to workspaces --- docs/data-sources/scalr_workspace.md | 5 +++-- scalr/data_source_workspace.go | 5 +++++ scalr/resource_scalr_workspace.go | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/data-sources/scalr_workspace.md b/docs/data-sources/scalr_workspace.md index e816ebde..f9840f43 100644 --- a/docs/data-sources/scalr_workspace.md +++ b/docs/data-sources/scalr_workspace.md @@ -45,7 +45,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 @@ -56,9 +56,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` - Boolean indicates whether git submodules of VCS repository should be fetched. 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/scalr/data_source_workspace.go b/scalr/data_source_workspace.go index 11578802..54503c7a 100644 --- a/scalr/data_source_workspace.go +++ b/scalr/data_source_workspace.go @@ -111,6 +111,10 @@ func dataSourceScalrWorkspace() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Computed: true, + }, }, }, }, @@ -186,6 +190,7 @@ func dataSourceScalrWorkspaceRead(d *schema.ResourceData, meta interface{}) erro "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 9b671709..092c5376 100644 --- a/scalr/resource_scalr_workspace.go +++ b/scalr/resource_scalr_workspace.go @@ -177,6 +177,11 @@ func resourceScalrWorkspace() *schema.Resource { Optional: true, Default: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, }, @@ -283,6 +288,7 @@ func resourceScalrWorkspaceCreate(d *schema.ResourceData, meta interface{}) erro 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. @@ -384,6 +390,7 @@ func resourceScalrWorkspaceRead(d *schema.ResourceData, meta interface{}) error "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) @@ -473,6 +480,7 @@ func resourceScalrWorkspaceUpdate(d *schema.ResourceData, meta interface{}) erro Path: scalr.String(vcsRepo["path"].(string)), TriggerPrefixes: &triggerPrefixes, DryRunsEnabled: scalr.Bool(vcsRepo["dry_runs_enabled"].(bool)), + IngressSubmodules: scalr.Bool(vcsRepo["ingress_submodules"].(bool)), } } From 5a649ea314895503cf56e4828a0d6f25a73a4117 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Tue, 5 Jul 2022 13:13:57 +0300 Subject: [PATCH 02/14] SCALRCORE-17117 Add vcs_repo.ingress_submodules to policy groups --- scalr/data_source_scalr_policy_group.go | 5 +++++ scalr/resource_scalr_policy_group.go | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/scalr/data_source_scalr_policy_group.go b/scalr/data_source_scalr_policy_group.go index c555a9eb..a99ea29a 100644 --- a/scalr/data_source_scalr_policy_group.go +++ b/scalr/data_source_scalr_policy_group.go @@ -50,6 +50,10 @@ func dataSourceScalrPolicyGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Computed: true, + }, }, }, }, @@ -135,6 +139,7 @@ func dataSourceScalrPolicyGroupRead(d *schema.ResourceData, meta interface{}) er "identifier": pg.VCSRepo.Identifier, "branch": pg.VCSRepo.Branch, "path": pg.VCSRepo.Path, + "ingress_submodules": pg.VCSRepo.IngressSubmodules, } vcsRepo = append(vcsRepo, vcsConfig) } diff --git a/scalr/resource_scalr_policy_group.go b/scalr/resource_scalr_policy_group.go index 98712805..84d93944 100644 --- a/scalr/resource_scalr_policy_group.go +++ b/scalr/resource_scalr_policy_group.go @@ -57,6 +57,10 @@ func resourceScalrPolicyGroup() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Optional: true, + }, }, }, }, @@ -121,6 +125,9 @@ func resourceScalrPolicyGroupCreate(d *schema.ResourceData, meta interface{}) er if path, ok := vcsRepo["path"].(string); ok && path != "" { vcsOpt.Path = scalr.String(path) } + if ingressSubmodules, ok := vcsRepo["ingress_submodules"].(bool); ok { + vcsOpt.IngressSubmodules = scalr.Bool(ingressSubmodules) + } opts := scalr.PolicyGroupCreateOptions{ Name: scalr.String(name), @@ -166,9 +173,10 @@ func resourceScalrPolicyGroupRead(d *schema.ResourceData, meta interface{}) erro d.Set("account_id", pg.Account.ID) d.Set("vcs_provider_id", pg.VcsProvider.ID) d.Set("vcs_repo", []map[string]interface{}{{ - "identifier": pg.VCSRepo.Identifier, - "branch": pg.VCSRepo.Branch, - "path": pg.VCSRepo.Path, + "identifier": pg.VCSRepo.Identifier, + "branch": pg.VCSRepo.Branch, + "path": pg.VCSRepo.Path, + "ingress_submodules": pg.VCSRepo.IngressSubmodules, }}) var policies []map[string]interface{} @@ -223,6 +231,9 @@ func resourceScalrPolicyGroupUpdate(d *schema.ResourceData, meta interface{}) er if path, ok := vcsRepo["path"].(string); ok && path != "" { vcsOpt.Path = scalr.String(path) } + if ingressSubmodules, ok := vcsRepo["ingress-submodules"].(bool); ok { + vcsOpt.IngressSubmodules = scalr.Bool(ingressSubmodules) + } opts := scalr.PolicyGroupUpdateOptions{ Name: scalr.String(name), From fd118e459e5c6d28ec920fd903ea97ff225b7fde Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Wed, 6 Jul 2022 09:01:43 +0300 Subject: [PATCH 03/14] SCALRCORE-17117 Fix updating policy group --- scalr/resource_scalr_policy_group.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scalr/resource_scalr_policy_group.go b/scalr/resource_scalr_policy_group.go index 84d93944..b1ffe9fd 100644 --- a/scalr/resource_scalr_policy_group.go +++ b/scalr/resource_scalr_policy_group.go @@ -231,8 +231,8 @@ func resourceScalrPolicyGroupUpdate(d *schema.ResourceData, meta interface{}) er if path, ok := vcsRepo["path"].(string); ok && path != "" { vcsOpt.Path = scalr.String(path) } - if ingressSubmodules, ok := vcsRepo["ingress-submodules"].(bool); ok { - vcsOpt.IngressSubmodules = scalr.Bool(ingressSubmodules) + if _, ok := vcsRepo["ingress_submodules"]; ok { + vcsOpt.IngressSubmodules = scalr.Bool(vcsRepo["ingress_submodules"].(bool)) } opts := scalr.PolicyGroupUpdateOptions{ From 22f928759eb23873aced017e6fa1d5739d7107e0 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Wed, 6 Jul 2022 09:02:18 +0300 Subject: [PATCH 04/14] SCALRCORE-17117 Add vcs_repo.ingress_submodules for modules --- scalr/resource_scalr_module.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scalr/resource_scalr_module.go b/scalr/resource_scalr_module.go index 590d1519..6933562c 100644 --- a/scalr/resource_scalr_module.go +++ b/scalr/resource_scalr_module.go @@ -57,6 +57,11 @@ func resourceScalrModule() *schema.Resource { Optional: true, ForceNew: true, }, + "ingress_submodules": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + }, }, }, }, @@ -92,6 +97,9 @@ func resourceScalrModuleCreate(d *schema.ResourceData, meta interface{}) error { if prefix, ok := vcsRepo["tag_prefix"].(string); ok && prefix != "" { vcsOpt.TagPrefix = scalr.String(prefix) } + if ingressSubmodules, ok := vcsRepo["ingress_submodules"].(bool); ok { + vcsOpt.IngressSubmodules = scalr.Bool(ingressSubmodules) + } opt := scalr.ModuleCreateOptions{ VCSRepo: vcsOpt, @@ -139,9 +147,10 @@ func resourceScalrModuleRead(d *schema.ResourceData, meta interface{}) error { d.Set("status", m.Status) d.Set("source", m.Source) d.Set("vcs_repo", []map[string]interface{}{{ - "identifier": m.VCSRepo.Identifier, - "path": m.VCSRepo.Path, - "tag_prefix": m.VCSRepo.TagPrefix, + "identifier": m.VCSRepo.Identifier, + "path": m.VCSRepo.Path, + "tag_prefix": m.VCSRepo.TagPrefix, + "ingress_submodules": m.VCSRepo.IngressSubmodules, }}) d.Set("vcs_provider_id", m.VcsProvider.ID) From 14ffef964932657a62e6d82bac4a3b7be1ce2c18 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Wed, 6 Jul 2022 09:08:10 +0300 Subject: [PATCH 05/14] SCALRCORE-17117 Update docs --- docs/data-sources/scalr_policy_group.md | 1 + docs/data-sources/scalr_workspace.md | 2 +- docs/resources/scalr_module.md | 1 + docs/resources/scalr_policy_group.md | 1 + docs/resources/scalr_workspace.md | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/data-sources/scalr_policy_group.md b/docs/data-sources/scalr_policy_group.md index d044c033..4c7e3c92 100644 --- a/docs/data-sources/scalr_policy_group.md +++ b/docs/data-sources/scalr_policy_group.md @@ -43,6 +43,7 @@ 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. +* `ingress_submodules` - Designates whether to clone git submodules of the VCS repository A `policies` list contains definitions of OPA policies in the following form: diff --git a/docs/data-sources/scalr_workspace.md b/docs/data-sources/scalr_workspace.md index f9840f43..d6b9746d 100644 --- a/docs/data-sources/scalr_workspace.md +++ b/docs/data-sources/scalr_workspace.md @@ -56,7 +56,7 @@ 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` - Boolean indicates whether git submodules of VCS repository should be fetched. +* `ingress_submodules` - Boolean indicates whether git submodules of the VCS repository should be fetched. The `created_by` block contains: diff --git a/docs/resources/scalr_module.md b/docs/resources/scalr_module.md index 5d4be966..dda84bec 100644 --- a/docs/resources/scalr_module.md +++ b/docs/resources/scalr_module.md @@ -39,6 +39,7 @@ resource "scalr_module" "example" { * `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/`. + * `ingress_submodules` - (Optional) Designates whether to clone git submodules of the VCS repository. ## Attribute Reference diff --git a/docs/resources/scalr_policy_group.md b/docs/resources/scalr_policy_group.md index 1f72a1e6..0d6500f3 100644 --- a/docs/resources/scalr_policy_group.md +++ b/docs/resources/scalr_policy_group.md @@ -36,6 +36,7 @@ resource "scalr_policy_group" "example" { * `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. + * `ingress_submodules` - (Optional) Designates whether to clone git submodules of the VCS repository. * `opa_version` - (Optional) The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned. diff --git a/docs/resources/scalr_workspace.md b/docs/resources/scalr_workspace.md index 3881b480..cbb2f542 100644 --- a/docs/resources/scalr_workspace.md +++ b/docs/resources/scalr_workspace.md @@ -109,6 +109,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) Set (true/false) to clone git submodules of the VCS repository. Default `false`. * `hooks` - (Optional) Settings for the workspaces custom hooks. From 40f6ebffb177f3f6f0091d6089926c46d16567a8 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Wed, 6 Jul 2022 09:22:52 +0300 Subject: [PATCH 06/14] SCALRCORE-17117 Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bb9b76c..535b66a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- `data.scalr_workspace`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) +- `scalr_policy_group`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) +- `data.scalr_policy_group`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) +- `scalr_module`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) + ## [1.0.0-rc31] - 2022-07-01 ### Added From 7a8126088a9d110d8c69a09558d14b06e1c02a14 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Wed, 6 Jul 2022 09:25:21 +0300 Subject: [PATCH 07/14] SCALRCORE-17117 Fix formatting --- scalr/data_source_scalr_policy_group.go | 8 ++--- scalr/data_source_workspace.go | 16 ++++----- scalr/resource_scalr_workspace.go | 44 ++++++++++++------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/scalr/data_source_scalr_policy_group.go b/scalr/data_source_scalr_policy_group.go index a99ea29a..45961501 100644 --- a/scalr/data_source_scalr_policy_group.go +++ b/scalr/data_source_scalr_policy_group.go @@ -136,10 +136,10 @@ func dataSourceScalrPolicyGroupRead(d *schema.ResourceData, meta interface{}) er var vcsRepo []interface{} if pg.VCSRepo != nil { vcsConfig := map[string]interface{}{ - "identifier": pg.VCSRepo.Identifier, - "branch": pg.VCSRepo.Branch, - "path": pg.VCSRepo.Path, - "ingress_submodules": pg.VCSRepo.IngressSubmodules, + "identifier": pg.VCSRepo.Identifier, + "branch": pg.VCSRepo.Branch, + "path": pg.VCSRepo.Path, + "ingress_submodules": pg.VCSRepo.IngressSubmodules, } vcsRepo = append(vcsRepo, vcsConfig) } diff --git a/scalr/data_source_workspace.go b/scalr/data_source_workspace.go index 54503c7a..e65bee15 100644 --- a/scalr/data_source_workspace.go +++ b/scalr/data_source_workspace.go @@ -111,10 +111,10 @@ func dataSourceScalrWorkspace() *schema.Resource { Type: schema.TypeBool, Computed: true, }, - "ingress_submodules": { - Type: schema.TypeBool, - Computed: true, - }, + "ingress_submodules": { + Type: schema.TypeBool, + Computed: true, + }, }, }, }, @@ -187,10 +187,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, - "ingress_submodules": workspace.VCSRepo.IngressSubmodules, + "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 092c5376..b7736877 100644 --- a/scalr/resource_scalr_workspace.go +++ b/scalr/resource_scalr_workspace.go @@ -177,11 +177,11 @@ func resourceScalrWorkspace() *schema.Resource { Optional: true, Default: true, }, - "ingress_submodules": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, + "ingress_submodules": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, }, @@ -284,11 +284,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)), - IngressSubmodules: scalr.Bool(vcsRepo["ingress_submodules"].(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. @@ -385,12 +385,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, - "ingress_submodules": workspace.VCSRepo.IngressSubmodules, + "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) @@ -475,12 +475,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)), - IngressSubmodules: scalr.Bool(vcsRepo["ingress_submodules"].(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)), } } From b663a173edb86736626613df06a00cbaaa210970 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Wed, 6 Jul 2022 09:39:06 +0300 Subject: [PATCH 08/14] SCALRCORE-17117 Update go-scalr dependency --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 1f727fde..a728c043 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 - github.com/scalr/go-scalr v0.0.0-20220610141547-9940d730b89c + github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac ) require ( diff --git a/go.sum b/go.sum index 7d43a53e..0ef739f6 100644 --- a/go.sum +++ b/go.sum @@ -304,6 +304,8 @@ github.com/scalr/go-scalr v0.0.0-20220523083310-b14d71171237 h1:M9d2EOzFFBe/9fqk github.com/scalr/go-scalr v0.0.0-20220523083310-b14d71171237/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/scalr/go-scalr v0.0.0-20220610141547-9940d730b89c h1:KZntuJEnSU4FL03yphXiYlxXi2NodIC8lqJoMzyNGpE= github.com/scalr/go-scalr v0.0.0-20220610141547-9940d730b89c/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac h1:BsXIUh6aDxe+zo/yAZnRChbxyc7Koo4a1IwgkFPNFxY= +github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 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= From 83d88f15a13fc37a7096d00047822a2cd08aa064 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Fri, 15 Jul 2022 12:35:49 +0300 Subject: [PATCH 09/14] SCALRCORE-17117 Update module requirements --- go.sum | 4 ---- 1 file changed, 4 deletions(-) diff --git a/go.sum b/go.sum index 0ef739f6..8c91ffd0 100644 --- a/go.sum +++ b/go.sum @@ -300,10 +300,6 @@ github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6D github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= 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/scalr/go-scalr v0.0.0-20220523083310-b14d71171237 h1:M9d2EOzFFBe/9fqkYpEKK0qKvh1RcZbA6dVWz4k3Rt8= -github.com/scalr/go-scalr v0.0.0-20220523083310-b14d71171237/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= -github.com/scalr/go-scalr v0.0.0-20220610141547-9940d730b89c h1:KZntuJEnSU4FL03yphXiYlxXi2NodIC8lqJoMzyNGpE= -github.com/scalr/go-scalr v0.0.0-20220610141547-9940d730b89c/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac h1:BsXIUh6aDxe+zo/yAZnRChbxyc7Koo4a1IwgkFPNFxY= github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= From 4ad1a0974a1cb6f65aa04d3a1aa1f626c98011ad Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Fri, 15 Jul 2022 13:30:12 +0300 Subject: [PATCH 10/14] SCALRCORE-17117 Update requirements --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a728c043..5e7687e0 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 - github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac + github.com/scalr/go-scalr v0.0.0-20220707072857-877323c020d7 ) require ( diff --git a/go.sum b/go.sum index 8c91ffd0..d1853977 100644 --- a/go.sum +++ b/go.sum @@ -300,8 +300,8 @@ github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6D github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= 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/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac h1:BsXIUh6aDxe+zo/yAZnRChbxyc7Koo4a1IwgkFPNFxY= -github.com/scalr/go-scalr v0.0.0-20220706055829-aa83effc39ac/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20220707072857-877323c020d7 h1:4ef19m1FpWHUnMR6ekTTQcnWPcXxN8aFYcMGFsBSl2A= +github.com/scalr/go-scalr v0.0.0-20220707072857-877323c020d7/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 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= @@ -478,6 +478,7 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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= From f9e2a694734a4dc96b039a8b623a1d9343e82454 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Fri, 15 Jul 2022 13:45:28 +0300 Subject: [PATCH 11/14] SCALRCORE-17117 Update docs & CHANGELOG --- CHANGELOG.md | 1 + docs/data-sources/scalr_policy_group.md | 2 +- docs/data-sources/scalr_workspace.md | 2 +- docs/resources/scalr_workspace.md | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fad5f97..9ed21f46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### 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_policy_group`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) - `data.scalr_policy_group`: added new attribute `vcs_repo.ingress_submodules` ([#146](https://github.com/Scalr/terraform-provider-scalr/pull/146)) diff --git a/docs/data-sources/scalr_policy_group.md b/docs/data-sources/scalr_policy_group.md index 4c7e3c92..978ee413 100644 --- a/docs/data-sources/scalr_policy_group.md +++ b/docs/data-sources/scalr_policy_group.md @@ -43,7 +43,7 @@ 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. -* `ingress_submodules` - Designates whether to clone git submodules of the VCS repository +* `ingress_submodules` - Designates whether to clone git submodules of the VCS repository. A `policies` list contains definitions of OPA policies in the following form: diff --git a/docs/data-sources/scalr_workspace.md b/docs/data-sources/scalr_workspace.md index d6b9746d..c60a25e9 100644 --- a/docs/data-sources/scalr_workspace.md +++ b/docs/data-sources/scalr_workspace.md @@ -56,7 +56,7 @@ 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` - Boolean indicates whether git submodules of the VCS repository should be fetched. +* `ingress_submodules` - Designates whether to clone git submodules of the VCS repository. The `created_by` block contains: diff --git a/docs/resources/scalr_workspace.md b/docs/resources/scalr_workspace.md index 9ce37496..b50e71d0 100644 --- a/docs/resources/scalr_workspace.md +++ b/docs/resources/scalr_workspace.md @@ -118,7 +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) Set (true/false) to clone git submodules of the VCS repository. Default `false`. + * `ingress_submodules` - (Optional) Designates whether to clone git submodules of the VCS repository. * `hooks` - (Optional) Settings for the workspaces custom hooks. From 872d90015a34b19a9217a16310c3bcc3452e269e Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Fri, 15 Jul 2022 13:53:19 +0300 Subject: [PATCH 12/14] SCALRCORE-17117 Add default values to ingress_submodules in resources --- scalr/resource_scalr_module.go | 1 + scalr/resource_scalr_policy_group.go | 1 + 2 files changed, 2 insertions(+) diff --git a/scalr/resource_scalr_module.go b/scalr/resource_scalr_module.go index 6933562c..053eef97 100644 --- a/scalr/resource_scalr_module.go +++ b/scalr/resource_scalr_module.go @@ -60,6 +60,7 @@ func resourceScalrModule() *schema.Resource { "ingress_submodules": { Type: schema.TypeBool, Optional: true, + Default: false, ForceNew: true, }, }, diff --git a/scalr/resource_scalr_policy_group.go b/scalr/resource_scalr_policy_group.go index b1ffe9fd..ce7fb037 100644 --- a/scalr/resource_scalr_policy_group.go +++ b/scalr/resource_scalr_policy_group.go @@ -60,6 +60,7 @@ func resourceScalrPolicyGroup() *schema.Resource { "ingress_submodules": { Type: schema.TypeBool, Optional: true, + Default: false, }, }, }, From 098043513c23d6420e783da0aaef456cd8648101 Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Fri, 15 Jul 2022 14:05:56 +0300 Subject: [PATCH 13/14] SCALRCORE-17117 Update refs --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5e7687e0..06635978 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 - github.com/scalr/go-scalr v0.0.0-20220707072857-877323c020d7 + github.com/scalr/go-scalr v0.0.0-20220715105727-84a7cef91aff ) require ( diff --git a/go.sum b/go.sum index d1853977..2c3626ef 100644 --- a/go.sum +++ b/go.sum @@ -300,8 +300,8 @@ github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6D github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= 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/scalr/go-scalr v0.0.0-20220707072857-877323c020d7 h1:4ef19m1FpWHUnMR6ekTTQcnWPcXxN8aFYcMGFsBSl2A= -github.com/scalr/go-scalr v0.0.0-20220707072857-877323c020d7/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20220715105727-84a7cef91aff h1:SQFGvZjNavm/cL8ipK6oFry7jotJaw3P2RbGMcfJ70c= +github.com/scalr/go-scalr v0.0.0-20220715105727-84a7cef91aff/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 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= From 09493d900f29d34801200fcba4bd85d11fe2016d Mon Sep 17 00:00:00 2001 From: Denys Kolomytskyi Date: Mon, 18 Jul 2022 13:32:38 +0300 Subject: [PATCH 14/14] SCALRCORE-17117 Remove ingress_submodules for policy groups & modules --- docs/data-sources/scalr_policy_group.md | 1 - docs/resources/scalr_module.md | 1 - docs/resources/scalr_policy_group.md | 1 - go.mod | 2 +- go.sum | 4 ++-- scalr/data_source_scalr_policy_group.go | 11 +++-------- scalr/resource_scalr_module.go | 16 +++------------- scalr/resource_scalr_policy_group.go | 18 +++--------------- 8 files changed, 12 insertions(+), 42 deletions(-) diff --git a/docs/data-sources/scalr_policy_group.md b/docs/data-sources/scalr_policy_group.md index 978ee413..d044c033 100644 --- a/docs/data-sources/scalr_policy_group.md +++ b/docs/data-sources/scalr_policy_group.md @@ -43,7 +43,6 @@ 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. -* `ingress_submodules` - Designates whether to clone git submodules of the VCS repository. A `policies` list contains definitions of OPA policies in the following form: diff --git a/docs/resources/scalr_module.md b/docs/resources/scalr_module.md index dda84bec..5d4be966 100644 --- a/docs/resources/scalr_module.md +++ b/docs/resources/scalr_module.md @@ -39,7 +39,6 @@ resource "scalr_module" "example" { * `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/`. - * `ingress_submodules` - (Optional) Designates whether to clone git submodules of the VCS repository. ## Attribute Reference diff --git a/docs/resources/scalr_policy_group.md b/docs/resources/scalr_policy_group.md index 0d6500f3..1f72a1e6 100644 --- a/docs/resources/scalr_policy_group.md +++ b/docs/resources/scalr_policy_group.md @@ -36,7 +36,6 @@ resource "scalr_policy_group" "example" { * `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. - * `ingress_submodules` - (Optional) Designates whether to clone git submodules of the VCS repository. * `opa_version` - (Optional) The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned. diff --git a/go.mod b/go.mod index 06635978..578bf62e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 - github.com/scalr/go-scalr v0.0.0-20220715105727-84a7cef91aff + github.com/scalr/go-scalr v0.0.0-20220711092821-b5bf24a47d01 ) require ( diff --git a/go.sum b/go.sum index 2c3626ef..80e736f4 100644 --- a/go.sum +++ b/go.sum @@ -300,8 +300,8 @@ github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6D github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= 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/scalr/go-scalr v0.0.0-20220715105727-84a7cef91aff h1:SQFGvZjNavm/cL8ipK6oFry7jotJaw3P2RbGMcfJ70c= -github.com/scalr/go-scalr v0.0.0-20220715105727-84a7cef91aff/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= +github.com/scalr/go-scalr v0.0.0-20220711092821-b5bf24a47d01 h1:6/XbSdPU+QKjC6q7X16DZQV6CV90ZpJ7vsF7hpsZ6c4= +github.com/scalr/go-scalr v0.0.0-20220711092821-b5bf24a47d01/go.mod h1:xMnwfer9UxugeNITZjTpQBwQ/4bw6/JdyDLpGdmyorE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 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= diff --git a/scalr/data_source_scalr_policy_group.go b/scalr/data_source_scalr_policy_group.go index 45961501..c555a9eb 100644 --- a/scalr/data_source_scalr_policy_group.go +++ b/scalr/data_source_scalr_policy_group.go @@ -50,10 +50,6 @@ func dataSourceScalrPolicyGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "ingress_submodules": { - Type: schema.TypeBool, - Computed: true, - }, }, }, }, @@ -136,10 +132,9 @@ func dataSourceScalrPolicyGroupRead(d *schema.ResourceData, meta interface{}) er var vcsRepo []interface{} if pg.VCSRepo != nil { vcsConfig := map[string]interface{}{ - "identifier": pg.VCSRepo.Identifier, - "branch": pg.VCSRepo.Branch, - "path": pg.VCSRepo.Path, - "ingress_submodules": pg.VCSRepo.IngressSubmodules, + "identifier": pg.VCSRepo.Identifier, + "branch": pg.VCSRepo.Branch, + "path": pg.VCSRepo.Path, } vcsRepo = append(vcsRepo, vcsConfig) } diff --git a/scalr/resource_scalr_module.go b/scalr/resource_scalr_module.go index 053eef97..590d1519 100644 --- a/scalr/resource_scalr_module.go +++ b/scalr/resource_scalr_module.go @@ -57,12 +57,6 @@ func resourceScalrModule() *schema.Resource { Optional: true, ForceNew: true, }, - "ingress_submodules": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, }, }, }, @@ -98,9 +92,6 @@ func resourceScalrModuleCreate(d *schema.ResourceData, meta interface{}) error { if prefix, ok := vcsRepo["tag_prefix"].(string); ok && prefix != "" { vcsOpt.TagPrefix = scalr.String(prefix) } - if ingressSubmodules, ok := vcsRepo["ingress_submodules"].(bool); ok { - vcsOpt.IngressSubmodules = scalr.Bool(ingressSubmodules) - } opt := scalr.ModuleCreateOptions{ VCSRepo: vcsOpt, @@ -148,10 +139,9 @@ func resourceScalrModuleRead(d *schema.ResourceData, meta interface{}) error { d.Set("status", m.Status) d.Set("source", m.Source) d.Set("vcs_repo", []map[string]interface{}{{ - "identifier": m.VCSRepo.Identifier, - "path": m.VCSRepo.Path, - "tag_prefix": m.VCSRepo.TagPrefix, - "ingress_submodules": m.VCSRepo.IngressSubmodules, + "identifier": m.VCSRepo.Identifier, + "path": m.VCSRepo.Path, + "tag_prefix": m.VCSRepo.TagPrefix, }}) d.Set("vcs_provider_id", m.VcsProvider.ID) diff --git a/scalr/resource_scalr_policy_group.go b/scalr/resource_scalr_policy_group.go index ce7fb037..98712805 100644 --- a/scalr/resource_scalr_policy_group.go +++ b/scalr/resource_scalr_policy_group.go @@ -57,11 +57,6 @@ func resourceScalrPolicyGroup() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "ingress_submodules": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, }, }, }, @@ -126,9 +121,6 @@ func resourceScalrPolicyGroupCreate(d *schema.ResourceData, meta interface{}) er if path, ok := vcsRepo["path"].(string); ok && path != "" { vcsOpt.Path = scalr.String(path) } - if ingressSubmodules, ok := vcsRepo["ingress_submodules"].(bool); ok { - vcsOpt.IngressSubmodules = scalr.Bool(ingressSubmodules) - } opts := scalr.PolicyGroupCreateOptions{ Name: scalr.String(name), @@ -174,10 +166,9 @@ func resourceScalrPolicyGroupRead(d *schema.ResourceData, meta interface{}) erro d.Set("account_id", pg.Account.ID) d.Set("vcs_provider_id", pg.VcsProvider.ID) d.Set("vcs_repo", []map[string]interface{}{{ - "identifier": pg.VCSRepo.Identifier, - "branch": pg.VCSRepo.Branch, - "path": pg.VCSRepo.Path, - "ingress_submodules": pg.VCSRepo.IngressSubmodules, + "identifier": pg.VCSRepo.Identifier, + "branch": pg.VCSRepo.Branch, + "path": pg.VCSRepo.Path, }}) var policies []map[string]interface{} @@ -232,9 +223,6 @@ func resourceScalrPolicyGroupUpdate(d *schema.ResourceData, meta interface{}) er if path, ok := vcsRepo["path"].(string); ok && path != "" { vcsOpt.Path = scalr.String(path) } - if _, ok := vcsRepo["ingress_submodules"]; ok { - vcsOpt.IngressSubmodules = scalr.Bool(vcsRepo["ingress_submodules"].(bool)) - } opts := scalr.PolicyGroupUpdateOptions{ Name: scalr.String(name),