diff --git a/docs/data-sources/policy_assignments.md b/docs/data-sources/policy_assignments.md index a5d8cdd4..6351510a 100644 --- a/docs/data-sources/policy_assignments.md +++ b/docs/data-sources/policy_assignments.md @@ -34,7 +34,6 @@ data "fmc_policy_assignments" "example" { - `name` (String) Name of the policy to be assigned. - `policy_id` (String) ID of the policy to be assigned. - `targets` (Attributes Set) (see [below for nested schema](#nestedatt--targets)) -- `type` (String) Type of the policy to be assigned. ### Nested Schema for `targets` @@ -42,5 +41,4 @@ data "fmc_policy_assignments" "example" { Read-Only: - `id` (String) -- `name` (String) - `type` (String) diff --git a/docs/resources/policy_assignments.md b/docs/resources/policy_assignments.md index a685ca1e..70b7abdc 100644 --- a/docs/resources/policy_assignments.md +++ b/docs/resources/policy_assignments.md @@ -36,7 +36,6 @@ resource "fmc_policy_assignments" "example" { - `domain` (String) The name of the FMC domain - `name` (String) Name of the policy to be assigned. -- `type` (String) Type of the policy to be assigned. ### Read-Only @@ -50,10 +49,6 @@ Required: - `id` (String) - `type` (String) - Choices: `Device`, `DeviceHAPair`, `DeviceGroup` -Optional: - -- `name` (String) - ## Import Import is supported using the following syntax: diff --git a/gen/definitions/policyassignments.yaml b/gen/definitions/policyassignments.yaml index d263f525..23b67e62 100644 --- a/gen/definitions/policyassignments.yaml +++ b/gen/definitions/policyassignments.yaml @@ -16,14 +16,6 @@ attributes: data_path: ["policy"] exclude_example: true exclude_test: true - - model_name: type - type: String - description: Type of the policy to be assigned. - mandatory: false - example: AccessPolicy - data_path: ["policy"] - exclude_example: true - exclude_test: true - model_name: id tf_name: policy_id type: String @@ -48,12 +40,6 @@ attributes: enum_values: [Device,DeviceHAPair,DeviceGroup] mandatory: true example: DeviceGroup - - model_name: name - type: String - mandatory: false - example: FTD_Device1 - exclude_example: true - exclude_test: true test_prerequisites: |- resource "fmc_access_control_policy" "example" { diff --git a/internal/provider/data_source_fmc_policy_assignments.go b/internal/provider/data_source_fmc_policy_assignments.go index d93e5835..a7200686 100644 --- a/internal/provider/data_source_fmc_policy_assignments.go +++ b/internal/provider/data_source_fmc_policy_assignments.go @@ -69,10 +69,6 @@ func (d *PolicyAssignmentsDataSource) Schema(ctx context.Context, req datasource MarkdownDescription: "Name of the policy to be assigned.", Computed: true, }, - "type": schema.StringAttribute{ - MarkdownDescription: "Type of the policy to be assigned.", - Computed: true, - }, "policy_id": schema.StringAttribute{ MarkdownDescription: "ID of the policy to be assigned.", Computed: true, @@ -90,10 +86,6 @@ func (d *PolicyAssignmentsDataSource) Schema(ctx context.Context, req datasource MarkdownDescription: "", Computed: true, }, - "name": schema.StringAttribute{ - MarkdownDescription: "", - Computed: true, - }, }, }, }, diff --git a/internal/provider/model_fmc_policy_assignments.go b/internal/provider/model_fmc_policy_assignments.go index 9a81ed20..499f0405 100644 --- a/internal/provider/model_fmc_policy_assignments.go +++ b/internal/provider/model_fmc_policy_assignments.go @@ -37,7 +37,6 @@ type PolicyAssignments struct { Id types.String `tfsdk:"id"` Domain types.String `tfsdk:"domain"` Name types.String `tfsdk:"name"` - Type types.String `tfsdk:"type"` PolicyId types.String `tfsdk:"policy_id"` Targets []PolicyAssignmentsTargets `tfsdk:"targets"` } @@ -45,7 +44,6 @@ type PolicyAssignments struct { type PolicyAssignmentsTargets struct { Id types.String `tfsdk:"id"` Type types.String `tfsdk:"type"` - Name types.String `tfsdk:"name"` } // End of section. //template:end types @@ -69,9 +67,6 @@ func (data PolicyAssignments) toBody(ctx context.Context, state PolicyAssignment if !data.Name.IsNull() { body, _ = sjson.Set(body, "policy.name", data.Name.ValueString()) } - if !data.Type.IsNull() { - body, _ = sjson.Set(body, "policy.type", data.Type.ValueString()) - } if !data.PolicyId.IsNull() { body, _ = sjson.Set(body, "policy.id", data.PolicyId.ValueString()) } @@ -85,9 +80,6 @@ func (data PolicyAssignments) toBody(ctx context.Context, state PolicyAssignment if !item.Type.IsNull() { itemBody, _ = sjson.Set(itemBody, "type", item.Type.ValueString()) } - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name", item.Name.ValueString()) - } body, _ = sjson.SetRaw(body, "targets.-1", itemBody) } } @@ -104,11 +96,6 @@ func (data *PolicyAssignments) fromBody(ctx context.Context, res gjson.Result) { } else { data.Name = types.StringNull() } - if value := res.Get("policy.type"); value.Exists() { - data.Type = types.StringValue(value.String()) - } else { - data.Type = types.StringNull() - } if value := res.Get("policy.id"); value.Exists() { data.PolicyId = types.StringValue(value.String()) } else { @@ -129,11 +116,6 @@ func (data *PolicyAssignments) fromBody(ctx context.Context, res gjson.Result) { } else { data.Type = types.StringNull() } - if value := res.Get("name"); value.Exists() { - data.Name = types.StringValue(value.String()) - } else { - data.Name = types.StringNull() - } (*parent).Targets = append((*parent).Targets, data) return true }) @@ -154,11 +136,6 @@ func (data *PolicyAssignments) fromBodyPartial(ctx context.Context, res gjson.Re } else { data.Name = types.StringNull() } - if value := res.Get("policy.type"); value.Exists() && !data.Type.IsNull() { - data.Type = types.StringValue(value.String()) - } else { - data.Type = types.StringNull() - } if value := res.Get("policy.id"); value.Exists() && !data.PolicyId.IsNull() { data.PolicyId = types.StringValue(value.String()) } else { @@ -210,11 +187,6 @@ func (data *PolicyAssignments) fromBodyPartial(ctx context.Context, res gjson.Re } else { data.Type = types.StringNull() } - if value := res.Get("name"); value.Exists() && !data.Name.IsNull() { - data.Name = types.StringValue(value.String()) - } else { - data.Name = types.StringNull() - } (*parent).Targets[i] = data } } diff --git a/internal/provider/resource_fmc_policy_assignments.go b/internal/provider/resource_fmc_policy_assignments.go index 355aad20..3c56ccc9 100644 --- a/internal/provider/resource_fmc_policy_assignments.go +++ b/internal/provider/resource_fmc_policy_assignments.go @@ -83,10 +83,6 @@ func (r *PolicyAssignmentsResource) Schema(ctx context.Context, req resource.Sch MarkdownDescription: helpers.NewAttributeDescription("Name of the policy to be assigned.").String, Optional: true, }, - "type": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Type of the policy to be assigned.").String, - Optional: true, - }, "policy_id": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("ID of the policy to be assigned.").String, Required: true, @@ -110,10 +106,6 @@ func (r *PolicyAssignmentsResource) Schema(ctx context.Context, req resource.Sch stringvalidator.OneOf("Device", "DeviceHAPair", "DeviceGroup"), }, }, - "name": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, - Optional: true, - }, }, }, },