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

Changes to prevent unnecessary tfe_registry_modules replacement #572

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.35.0 (July 27th, 2022)

BUG FIXES:
* Added `Computed` modifier to attributes in `r/tfe_registry_modules` to prevent unnecessary registry modules update. ([#572](https://github.com/hashicorp/terraform-provider-tfe/pull/572))
Uk1288 marked this conversation as resolved.
Show resolved Hide resolved

## 0.34.0 (July 26th, 2022)

BUG FIXES:
Expand Down
5 changes: 5 additions & 0 deletions tfe/resource_tfe_registry_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ func resourceTFERegistryModule() *schema.Resource {
"organization": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"module_provider": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ExactlyOneOf: []string{"vcs_repo"},
RequiredWith: []string{"organization", "name"},
},
"name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"vcs_repo": {
Expand Down Expand Up @@ -68,12 +71,14 @@ func resourceTFERegistryModule() *schema.Resource {
"namespace": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
RequiredWith: []string{"registry_name"},
},
"registry_name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
RequiredWith: []string{"module_provider"},
ValidateFunc: validation.StringInSlice(
Expand Down
18 changes: 6 additions & 12 deletions tfe/resource_tfe_registry_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func TestAccTFERegistryModule_vcs(t *testing.T) {
CheckDestroy: testAccCheckTFERegistryModuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccTFERegistryModule_vcs(rInt),
ExpectNonEmptyPlan: true,
Config: testAccTFERegistryModule_vcs(rInt),
Check: resource.ComposeTestCheckFunc(
testAccCheckTFERegistryModuleExists(
"tfe_registry_module.foobar",
Expand Down Expand Up @@ -111,8 +110,7 @@ func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithoutRegistryName(t *
CheckDestroy: testAccCheckTFERegistryModuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccTFERegistryModule_privateRMWithoutRegistryName(rInt),
ExpectNonEmptyPlan: true,
Config: testAccTFERegistryModule_privateRMWithoutRegistryName(rInt),
Check: resource.ComposeTestCheckFunc(
testAccCheckTFERegistryModuleExists(
"tfe_registry_module.foobar",
Expand Down Expand Up @@ -161,8 +159,7 @@ func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithRegistryName(t *tes
CheckDestroy: testAccCheckTFERegistryModuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccTFERegistryModule_privateRMWithRegistryName(rInt),
ExpectNonEmptyPlan: true,
Config: testAccTFERegistryModule_privateRMWithRegistryName(rInt),
Check: resource.ComposeTestCheckFunc(
testAccCheckTFERegistryModuleExists(
"tfe_registry_module.foobar",
Expand Down Expand Up @@ -251,8 +248,7 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMDeprecatedFormat(t *testing.T) {
CheckDestroy: testAccCheckTFERegistryModuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccTFERegistryModule_vcs(rInt),
ExpectNonEmptyPlan: true,
Config: testAccTFERegistryModule_vcs(rInt),
},
{
ResourceName: "tfe_registry_module.foobar",
Expand All @@ -276,8 +272,7 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat(t *testing.T)
CheckDestroy: testAccCheckTFERegistryModuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccTFERegistryModule_vcs(rInt),
ExpectNonEmptyPlan: true,
Config: testAccTFERegistryModule_vcs(rInt),
},
{
ResourceName: "tfe_registry_module.foobar",
Expand All @@ -300,8 +295,7 @@ func TestAccTFERegistryModuleImport_nonVCSPrivateRM(t *testing.T) {
CheckDestroy: testAccCheckTFERegistryModuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccTFERegistryModule_privateRMWithRegistryName(rInt),
ExpectNonEmptyPlan: true,
Config: testAccTFERegistryModule_privateRMWithRegistryName(rInt),
},
{
ResourceName: "tfe_registry_module.foobar",
Expand Down