Skip to content

Commit a246946

Browse files
Remove job_type property from azurerm_storage_mover_job_definition
Per reviewer feedback, the job_type feature should be separated into its own PR. Remove the job_type property from the resource schema, model, CRUD logic, tests, and documentation.
1 parent c8f68d2 commit a246946

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

internal/services/storagemover/storage_mover_job_definition_resource.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type StorageMoverJobDefinitionResourceModel struct {
2424
SourceName string `tfschema:"source_name"`
2525
TargetName string `tfschema:"target_name"`
2626
CopyMode jobdefinitions.CopyMode `tfschema:"copy_mode"`
27-
JobType string `tfschema:"job_type"`
2827
SourceSubpath string `tfschema:"source_sub_path"`
2928
TargetSubpath string `tfschema:"target_sub_path"`
3029
AgentName string `tfschema:"agent_name"`
@@ -89,17 +88,6 @@ func (r StorageMoverJobDefinitionResource) Arguments() map[string]*pluginsdk.Sch
8988
}, false),
9089
},
9190

92-
"job_type": {
93-
Type: pluginsdk.TypeString,
94-
Optional: true,
95-
ForceNew: true,
96-
Default: string(jobdefinitions.JobTypeOnPremToCloud),
97-
ValidateFunc: validation.StringInSlice([]string{
98-
string(jobdefinitions.JobTypeOnPremToCloud),
99-
string(jobdefinitions.JobTypeCloudToCloud),
100-
}, false),
101-
},
102-
10391
"source_sub_path": {
10492
Type: pluginsdk.TypeString,
10593
Optional: true,
@@ -165,11 +153,6 @@ func (r StorageMoverJobDefinitionResource) Create() sdk.ResourceFunc {
165153
},
166154
}
167155

168-
if model.JobType != "" {
169-
jobType := jobdefinitions.JobType(model.JobType)
170-
properties.Properties.JobType = &jobType
171-
}
172-
173156
if model.AgentName != "" {
174157
properties.Properties.AgentName = &model.AgentName
175158
}
@@ -283,10 +266,6 @@ func (r StorageMoverJobDefinitionResource) Read() sdk.ResourceFunc {
283266

284267
state.Description = pointer.From(v.Properties.Description)
285268

286-
if v.Properties.JobType != nil {
287-
state.JobType = string(*v.Properties.JobType)
288-
}
289-
290269
state.SourceName = v.Properties.SourceName
291270

292271
state.SourceSubpath = pointer.From(v.Properties.SourceSubpath)

internal/services/storagemover/storage_mover_job_definition_resource_test.go

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,6 @@ func TestAccStorageMoverJobDefinition_update(t *testing.T) {
8282
})
8383
}
8484

85-
func TestAccStorageMoverJobDefinition_withJobType(t *testing.T) {
86-
data := acceptance.BuildTestData(t, "azurerm_storage_mover_job_definition", "test")
87-
r := StorageMoverJobDefinitionTestResource{}
88-
data.ResourceTest(t, r, []acceptance.TestStep{
89-
{
90-
Config: r.withJobType(data),
91-
Check: acceptance.ComposeTestCheckFunc(
92-
check.That(data.ResourceName).ExistsInAzure(r),
93-
check.That(data.ResourceName).Key("job_type").HasValue("CloudToCloud"),
94-
),
95-
},
96-
data.ImportStep(),
97-
})
98-
}
99-
10085
func (r StorageMoverJobDefinitionTestResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
10186
id, err := jobdefinitions.ParseJobDefinitionID(state.ID)
10287
if err != nil {
@@ -258,28 +243,3 @@ resource "azurerm_storage_mover_job_definition" "test" {
258243
}
259244
`, template, data.RandomInteger)
260245
}
261-
262-
func (r StorageMoverJobDefinitionTestResource) withJobType(data acceptance.TestData) string {
263-
template := r.template(data)
264-
return fmt.Sprintf(`
265-
provider "azurerm" {
266-
features {
267-
resource_group {
268-
prevent_deletion_if_contains_resources = false
269-
}
270-
}
271-
}
272-
273-
%s
274-
275-
resource "azurerm_storage_mover_job_definition" "test" {
276-
name = "acctest-sjd-%[2]d"
277-
storage_mover_project_id = azurerm_storage_mover_project.test.id
278-
copy_mode = "Additive"
279-
job_type = "CloudToCloud"
280-
source_name = azurerm_storage_mover_source_endpoint.test.name
281-
target_name = azurerm_storage_mover_target_endpoint.test.name
282-
description = "CloudToCloud Job Definition"
283-
}
284-
`, template, data.RandomInteger)
285-
}

website/docs/r/storage_mover_job_definition.html.markdown

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ The following arguments are supported:
9191

9292
* `copy_mode` - (Required) Specifies the strategy to use for copy. Possible values are `Additive` and `Mirror`.
9393

94-
* `job_type` - (Optional) Specifies the type of job to run. Possible values are `OnPremToCloud` and `CloudToCloud`. Defaults to `OnPremToCloud`. Changing this forces a new resource to be created.
95-
9694
* `source_sub_path` - (Optional) Specifies the sub path to use when reading from the Storage Mover Source Endpoint. Changing this forces a new resource to be created.
9795

9896
* `target_sub_path` - (Optional) Specifies the sub path to use when writing to the Storage Mover Target Endpoint. Changing this forces a new resource to be created.

0 commit comments

Comments
 (0)