Skip to content

Commit 71766e5

Browse files
committed
Rename tfe_organization_default_execution_mode -> tfe_organization_default_settings
Even though the diff is large, there are no code changes and some minor documentation repairs.
1 parent 730c856 commit 71766e5

File tree

4 files changed

+94
-89
lines changed

4 files changed

+94
-89
lines changed

internal/provider/provider.go

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -106,45 +106,45 @@ func Provider() *schema.Provider {
106106
},
107107

108108
ResourcesMap: map[string]*schema.Resource{
109-
"tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(),
110-
"tfe_agent_pool": resourceTFEAgentPool(),
111-
"tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(),
112-
"tfe_agent_token": resourceTFEAgentToken(),
113-
"tfe_notification_configuration": resourceTFENotificationConfiguration(),
114-
"tfe_oauth_client": resourceTFEOAuthClient(),
115-
"tfe_organization": resourceTFEOrganization(),
116-
"tfe_organization_default_execution_mode": resourceTFEOrganizationDefaultExecutionMode(),
117-
"tfe_organization_membership": resourceTFEOrganizationMembership(),
118-
"tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(),
119-
"tfe_organization_run_task": resourceTFEOrganizationRunTask(),
120-
"tfe_organization_token": resourceTFEOrganizationToken(),
121-
"tfe_policy": resourceTFEPolicy(),
122-
"tfe_policy_set": resourceTFEPolicySet(),
123-
"tfe_policy_set_parameter": resourceTFEPolicySetParameter(),
124-
"tfe_project": resourceTFEProject(),
125-
"tfe_project_policy_set": resourceTFEProjectPolicySet(),
126-
"tfe_project_variable_set": resourceTFEProjectVariableSet(),
127-
"tfe_registry_module": resourceTFERegistryModule(),
128-
"tfe_no_code_module": resourceTFENoCodeModule(),
129-
"tfe_run_trigger": resourceTFERunTrigger(),
130-
"tfe_sentinel_policy": resourceTFESentinelPolicy(),
131-
"tfe_ssh_key": resourceTFESSHKey(),
132-
"tfe_team": resourceTFETeam(),
133-
"tfe_team_access": resourceTFETeamAccess(),
134-
"tfe_team_organization_member": resourceTFETeamOrganizationMember(),
135-
"tfe_team_organization_members": resourceTFETeamOrganizationMembers(),
136-
"tfe_team_project_access": resourceTFETeamProjectAccess(),
137-
"tfe_team_member": resourceTFETeamMember(),
138-
"tfe_team_members": resourceTFETeamMembers(),
139-
"tfe_team_token": resourceTFETeamToken(),
140-
"tfe_terraform_version": resourceTFETerraformVersion(),
141-
"tfe_workspace": resourceTFEWorkspace(),
142-
"tfe_workspace_run_task": resourceTFEWorkspaceRunTask(),
143-
"tfe_variable_set": resourceTFEVariableSet(),
144-
"tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(),
145-
"tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(),
146-
"tfe_workspace_run": resourceTFEWorkspaceRun(),
147-
"tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(),
109+
"tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(),
110+
"tfe_agent_pool": resourceTFEAgentPool(),
111+
"tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(),
112+
"tfe_agent_token": resourceTFEAgentToken(),
113+
"tfe_notification_configuration": resourceTFENotificationConfiguration(),
114+
"tfe_oauth_client": resourceTFEOAuthClient(),
115+
"tfe_organization": resourceTFEOrganization(),
116+
"tfe_organization_default_settings": resourceTFEOrganizationDefaultSettings(),
117+
"tfe_organization_membership": resourceTFEOrganizationMembership(),
118+
"tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(),
119+
"tfe_organization_run_task": resourceTFEOrganizationRunTask(),
120+
"tfe_organization_token": resourceTFEOrganizationToken(),
121+
"tfe_policy": resourceTFEPolicy(),
122+
"tfe_policy_set": resourceTFEPolicySet(),
123+
"tfe_policy_set_parameter": resourceTFEPolicySetParameter(),
124+
"tfe_project": resourceTFEProject(),
125+
"tfe_project_policy_set": resourceTFEProjectPolicySet(),
126+
"tfe_project_variable_set": resourceTFEProjectVariableSet(),
127+
"tfe_registry_module": resourceTFERegistryModule(),
128+
"tfe_no_code_module": resourceTFENoCodeModule(),
129+
"tfe_run_trigger": resourceTFERunTrigger(),
130+
"tfe_sentinel_policy": resourceTFESentinelPolicy(),
131+
"tfe_ssh_key": resourceTFESSHKey(),
132+
"tfe_team": resourceTFETeam(),
133+
"tfe_team_access": resourceTFETeamAccess(),
134+
"tfe_team_organization_member": resourceTFETeamOrganizationMember(),
135+
"tfe_team_organization_members": resourceTFETeamOrganizationMembers(),
136+
"tfe_team_project_access": resourceTFETeamProjectAccess(),
137+
"tfe_team_member": resourceTFETeamMember(),
138+
"tfe_team_members": resourceTFETeamMembers(),
139+
"tfe_team_token": resourceTFETeamToken(),
140+
"tfe_terraform_version": resourceTFETerraformVersion(),
141+
"tfe_workspace": resourceTFEWorkspace(),
142+
"tfe_workspace_run_task": resourceTFEWorkspaceRunTask(),
143+
"tfe_variable_set": resourceTFEVariableSet(),
144+
"tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(),
145+
"tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(),
146+
"tfe_workspace_run": resourceTFEWorkspaceRun(),
147+
"tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(),
148148
},
149149
ConfigureContextFunc: configure(),
150150
}

internal/provider/resource_tfe_organization_default_execution_mode.go renamed to internal/provider/resource_tfe_organization_default_settings.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import (
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1212
)
1313

14-
func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource {
14+
func resourceTFEOrganizationDefaultSettings() *schema.Resource {
1515
return &schema.Resource{
16-
Create: resourceTFEOrganizationDefaultExecutionModeCreate,
17-
Read: resourceTFEOrganizationDefaultExecutionModeRead,
18-
Delete: resourceTFEOrganizationDefaultExecutionModeDelete,
16+
Create: resourceTFEOrganizationDefaultSettingsCreate,
17+
Read: resourceTFEOrganizationDefaultSettingsRead,
18+
Delete: resourceTFEOrganizationDefaultSettingsDelete,
1919
Importer: &schema.ResourceImporter{
20-
StateContext: resourceTFEOrganizationDefaultExecutionModeImporter,
20+
StateContext: resourceTFEOrganizationDefaultSettingsImporter,
2121
},
2222

2323
CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged,
@@ -53,7 +53,7 @@ func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource {
5353
}
5454
}
5555

56-
func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, meta interface{}) error {
56+
func resourceTFEOrganizationDefaultSettingsCreate(d *schema.ResourceData, meta interface{}) error {
5757
config := meta.(ConfiguredClient)
5858

5959
// Get the organization name.
@@ -88,10 +88,10 @@ func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, m
8888

8989
d.SetId(organization)
9090

91-
return resourceTFEOrganizationDefaultExecutionModeRead(d, meta)
91+
return resourceTFEOrganizationDefaultSettingsRead(d, meta)
9292
}
9393

94-
func resourceTFEOrganizationDefaultExecutionModeRead(d *schema.ResourceData, meta interface{}) error {
94+
func resourceTFEOrganizationDefaultSettingsRead(d *schema.ResourceData, meta interface{}) error {
9595
config := meta.(ConfiguredClient)
9696

9797
log.Printf("[DEBUG] Read the organization: %s", d.Id())
@@ -119,7 +119,7 @@ func resourceTFEOrganizationDefaultExecutionModeRead(d *schema.ResourceData, met
119119
return nil
120120
}
121121

122-
func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, meta interface{}) error {
122+
func resourceTFEOrganizationDefaultSettingsDelete(d *schema.ResourceData, meta interface{}) error {
123123
config := meta.(ConfiguredClient)
124124

125125
// Get the organization name.
@@ -141,7 +141,7 @@ func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, m
141141
return nil
142142
}
143143

144-
func resourceTFEOrganizationDefaultExecutionModeImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
144+
func resourceTFEOrganizationDefaultSettingsImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
145145
config := meta.(ConfiguredClient)
146146

147147
log.Printf("[DEBUG] Read the organization: %s", d.Id())

internal/provider/resource_tfe_organization_default_execution_mode_test.go renamed to internal/provider/resource_tfe_organization_default_settings_test.go

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"time"
88

99
"errors"
10+
1011
tfe "github.com/hashicorp/go-tfe"
1112
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1213
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1314
)
1415

15-
func TestAccTFEOrganizationDefaultExecutionMode_remote(t *testing.T) {
16+
func TestAccTFEOrganizationDefaultSettings_remote(t *testing.T) {
1617
org := &tfe.Organization{}
1718
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
1819

@@ -22,18 +23,18 @@ func TestAccTFEOrganizationDefaultExecutionMode_remote(t *testing.T) {
2223
CheckDestroy: testAccCheckTFEOrganizationDestroy,
2324
Steps: []resource.TestStep{
2425
{
25-
Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt),
26+
Config: testAccTFEOrganizationDefaultSettings_remote(rInt),
2627
Check: resource.ComposeTestCheckFunc(
2728
testAccCheckTFEOrganizationExists(
2829
"tfe_organization.foobar", org),
29-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"),
30+
testAccCheckTFEOrganizationDefaultSettings(org, "remote"),
3031
),
3132
},
3233
},
3334
})
3435
}
3536

36-
func TestAccTFEOrganizationDefaultExecutionMode_local(t *testing.T) {
37+
func TestAccTFEOrganizationDefaultSettings_local(t *testing.T) {
3738
org := &tfe.Organization{}
3839
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
3940

@@ -43,18 +44,18 @@ func TestAccTFEOrganizationDefaultExecutionMode_local(t *testing.T) {
4344
CheckDestroy: testAccCheckTFEOrganizationDestroy,
4445
Steps: []resource.TestStep{
4546
{
46-
Config: testAccTFEOrganizationDefaultExecutionMode_local(rInt),
47+
Config: testAccTFEOrganizationDefaultSettings_local(rInt),
4748
Check: resource.ComposeTestCheckFunc(
4849
testAccCheckTFEOrganizationExists(
4950
"tfe_organization.foobar", org),
50-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "local"),
51+
testAccCheckTFEOrganizationDefaultSettings(org, "local"),
5152
),
5253
},
5354
},
5455
})
5556
}
5657

57-
func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) {
58+
func TestAccTFEOrganizationDefaultSettings_agent(t *testing.T) {
5859
org := &tfe.Organization{}
5960
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
6061

@@ -64,19 +65,19 @@ func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) {
6465
CheckDestroy: testAccCheckTFEOrganizationDestroy,
6566
Steps: []resource.TestStep{
6667
{
67-
Config: testAccTFEOrganizationDefaultExecutionMode_agent(rInt),
68+
Config: testAccTFEOrganizationDefaultSettings_agent(rInt),
6869
Check: resource.ComposeTestCheckFunc(
6970
testAccCheckTFEOrganizationExists(
7071
"tfe_organization.foobar", org),
71-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"),
72+
testAccCheckTFEOrganizationDefaultSettings(org, "agent"),
7273
testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org),
7374
),
7475
},
7576
},
7677
})
7778
}
7879

79-
func TestAccTFEOrganizationDefaultExecutionMode_update(t *testing.T) {
80+
func TestAccTFEOrganizationDefaultSettings_update(t *testing.T) {
8081
org := &tfe.Organization{}
8182
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
8283

@@ -86,43 +87,43 @@ func TestAccTFEOrganizationDefaultExecutionMode_update(t *testing.T) {
8687
CheckDestroy: testAccCheckTFEOrganizationDestroy,
8788
Steps: []resource.TestStep{
8889
{
89-
Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt),
90+
Config: testAccTFEOrganizationDefaultSettings_remote(rInt),
9091
Check: resource.ComposeTestCheckFunc(
9192
testAccCheckTFEOrganizationExists(
9293
"tfe_organization.foobar", org),
93-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"),
94+
testAccCheckTFEOrganizationDefaultSettings(org, "remote"),
9495
),
9596
},
9697
{
97-
Config: testAccTFEOrganizationDefaultExecutionMode_agent(rInt),
98+
Config: testAccTFEOrganizationDefaultSettings_agent(rInt),
9899
Check: resource.ComposeTestCheckFunc(
99100
testAccCheckTFEOrganizationExists(
100101
"tfe_organization.foobar", org),
101-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"),
102+
testAccCheckTFEOrganizationDefaultSettings(org, "agent"),
102103
testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org),
103104
),
104105
},
105106
{
106-
Config: testAccTFEOrganizationDefaultExecutionMode_local(rInt),
107+
Config: testAccTFEOrganizationDefaultSettings_local(rInt),
107108
Check: resource.ComposeTestCheckFunc(
108109
testAccCheckTFEOrganizationExists(
109110
"tfe_organization.foobar", org),
110-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "local"),
111+
testAccCheckTFEOrganizationDefaultSettings(org, "local"),
111112
),
112113
},
113114
{
114-
Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt),
115+
Config: testAccTFEOrganizationDefaultSettings_remote(rInt),
115116
Check: resource.ComposeTestCheckFunc(
116117
testAccCheckTFEOrganizationExists(
117118
"tfe_organization.foobar", org),
118-
testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"),
119+
testAccCheckTFEOrganizationDefaultSettings(org, "remote"),
119120
),
120121
},
121122
},
122123
})
123124
}
124125

125-
func TestAccTFEOrganizationDefaultExecutionMode_import(t *testing.T) {
126+
func TestAccTFEOrganizationDefaultSettings_import(t *testing.T) {
126127
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
127128

128129
resource.Test(t, resource.TestCase{
@@ -131,19 +132,19 @@ func TestAccTFEOrganizationDefaultExecutionMode_import(t *testing.T) {
131132
CheckDestroy: testAccCheckTFEOrganizationDestroy,
132133
Steps: []resource.TestStep{
133134
{
134-
Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt),
135+
Config: testAccTFEOrganizationDefaultSettings_remote(rInt),
135136
},
136137

137138
{
138-
ResourceName: "tfe_organization_default_execution_mode.foobar",
139+
ResourceName: "tfe_organization_default_settings.foobar",
139140
ImportState: true,
140141
ImportStateVerify: true,
141142
},
142143
},
143144
})
144145
}
145146

146-
func testAccCheckTFEOrganizationDefaultExecutionMode(org *tfe.Organization, expectedExecutionMode string) resource.TestCheckFunc {
147+
func testAccCheckTFEOrganizationDefaultSettings(org *tfe.Organization, expectedExecutionMode string) resource.TestCheckFunc {
147148
return func(s *terraform.State) error {
148149
if org.DefaultExecutionMode != expectedExecutionMode {
149150
return fmt.Errorf("default Execution Mode did not match, expected: %s, but was: %s", expectedExecutionMode, org.DefaultExecutionMode)
@@ -163,33 +164,33 @@ func testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org *tfe.Organization)
163164
}
164165
}
165166

166-
func testAccTFEOrganizationDefaultExecutionMode_remote(rInt int) string {
167+
func testAccTFEOrganizationDefaultSettings_remote(rInt int) string {
167168
return fmt.Sprintf(`
168169
resource "tfe_organization" "foobar" {
169170
name = "tst-terraform-%d"
170171
171172
}
172173
173-
resource "tfe_organization_default_execution_mode" "foobar" {
174+
resource "tfe_organization_default_settings" "foobar" {
174175
organization = tfe_organization.foobar.name
175176
default_execution_mode = "remote"
176177
}`, rInt)
177178
}
178179

179-
func testAccTFEOrganizationDefaultExecutionMode_local(rInt int) string {
180+
func testAccTFEOrganizationDefaultSettings_local(rInt int) string {
180181
return fmt.Sprintf(`
181182
resource "tfe_organization" "foobar" {
182183
name = "tst-terraform-%d"
183184
184185
}
185186
186-
resource "tfe_organization_default_execution_mode" "foobar" {
187+
resource "tfe_organization_default_settings" "foobar" {
187188
organization = tfe_organization.foobar.name
188189
default_execution_mode = "local"
189190
}`, rInt)
190191
}
191192

192-
func testAccTFEOrganizationDefaultExecutionMode_agent(rInt int) string {
193+
func testAccTFEOrganizationDefaultSettings_agent(rInt int) string {
193194
return fmt.Sprintf(`
194195
resource "tfe_organization" "foobar" {
195196
name = "tst-terraform-%d"
@@ -201,7 +202,7 @@ resource "tfe_agent_pool" "foobar" {
201202
organization = tfe_organization.foobar.name
202203
}
203204
204-
resource "tfe_organization_default_execution_mode" "foobar" {
205+
resource "tfe_organization_default_settings" "foobar" {
205206
organization = tfe_organization.foobar.name
206207
default_execution_mode = "agent"
207208
default_agent_pool_id = tfe_agent_pool.foobar.id

0 commit comments

Comments
 (0)