diff --git a/docs/data-sources/application_epg.md b/docs/data-sources/application_epg.md index 6cd1421a4..cf4e50743 100644 --- a/docs/data-sources/application_epg.md +++ b/docs/data-sources/application_epg.md @@ -61,6 +61,7 @@ data "aci_application_epg" "example_application_profile" { * `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the EPG is part of the preferred group. Members of this group are allowed to communicate without contracts. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Application EPG object. * `admin_state` (shutdown) - (string) Withdraw AEPg Configuration from all Nodes in the Fabric. * `epg_useg_block_statement` - (map) A map of EPG uSeg Block Statement (ACI object [fvCrtrn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCrtrn/overview)). This attribute is supported in ACI versions: 1.1(1j) and later. * `annotation` (annotation) - (string) The annotation of the EPG uSeg Block Statement object. diff --git a/docs/data-sources/bridge_domain.md b/docs/data-sources/bridge_domain.md index dc654d46c..06988e0c9 100644 --- a/docs/data-sources/bridge_domain.md +++ b/docs/data-sources/bridge_domain.md @@ -69,6 +69,9 @@ data "aci_bridge_domain" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the Bridge Domain object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. +* `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Bridge Domain object. +* `segment` (seg) - (string) The segment ID (L2-VNI) of the Bridge Domain object. * `bridge_domain_type` (type) - (string) The domain type of the Bridge Domain object. * `unicast_routing` (unicastRoute) - (string) Enables L3 routing and endpoint IP learning for the Bridge Domain object. * `l2_unknown_unicast_flooding` (unkMacUcastAct) - (string) The forwarding method for unknown layer 2 destinations. diff --git a/docs/data-sources/endpoint_security_group.md b/docs/data-sources/endpoint_security_group.md index 254d89604..af60a9adc 100644 --- a/docs/data-sources/endpoint_security_group.md +++ b/docs/data-sources/endpoint_security_group.md @@ -56,6 +56,7 @@ data "aci_endpoint_security_group" "example_application_profile" { * `intra_esg_isolation` (pcEnfPref) - (string) Parameter used to determine whether communication between endpoints within the ESG is blocked. * `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Endpoint Security Group object. * `admin_state` (shutdown) - (string) Withdraw the ESG configuration from all nodes in the fabric. * `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). This attribute is supported in ACI versions: 1.0(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. diff --git a/docs/resources/application_epg.md b/docs/resources/application_epg.md index 01b0f102d..1995338ca 100644 --- a/docs/resources/application_epg.md +++ b/docs/resources/application_epg.md @@ -446,6 +446,8 @@ All examples for the Application EPG resource can be found in the [examples](htt * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Application EPG object. + - Default: `0` * `admin_state` (shutdown) - (string) Withdraw AEPg Configuration from all Nodes in the Fabric. - Default: `no` - Valid Values: `no`, `yes`. diff --git a/docs/resources/bridge_domain.md b/docs/resources/bridge_domain.md index 390af04bf..0b47a085a 100644 --- a/docs/resources/bridge_domain.md +++ b/docs/resources/bridge_domain.md @@ -383,6 +383,10 @@ All examples for the Bridge Domain resource can be found in the [examples](https * `name_alias` (nameAlias) - (string) The name alias of the Bridge Domain object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. +* `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Bridge Domain object. + - Default: `0` +* `segment` (seg) - (string) The segment ID (L2-VNI) of the Bridge Domain object. * `bridge_domain_type` (type) - (string) The domain type of the Bridge Domain object. - Default: `regular` - Valid Values: `fc`, `regular`. diff --git a/docs/resources/endpoint_security_group.md b/docs/resources/endpoint_security_group.md index 03805e419..444dbbe75 100644 --- a/docs/resources/endpoint_security_group.md +++ b/docs/resources/endpoint_security_group.md @@ -214,6 +214,8 @@ All examples for the Endpoint Security Group resource can be found in the [examp * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts. - Default: `exclude` - Valid Values: `exclude`, `include`. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Endpoint Security Group object. + - Default: `0` * `admin_state` (shutdown) - (string) Withdraw the ESG configuration from all nodes in the fabric. - Default: `no` - Valid Values: `no`, `yes`. diff --git a/gen/testvars/fvAEPg.yaml b/gen/testvars/fvAEPg.yaml index 072832892..597252601 100644 --- a/gen/testvars/fvAEPg.yaml +++ b/gen/testvars/fvAEPg.yaml @@ -35,6 +35,7 @@ custom_type: read_only: - "pc_tag" + - "scope" all: annotation: "annotation" @@ -52,6 +53,8 @@ all: 4.0(1h): has_multicast_source: "no" admin_state: "no" + 4.1(1i): + scope: "0" children: epg_useg_block_statement: diff --git a/gen/testvars/fvBD.yaml b/gen/testvars/fvBD.yaml index 2f5a503e7..c0f5e9124 100644 --- a/gen/testvars/fvBD.yaml +++ b/gen/testvars/fvBD.yaml @@ -45,6 +45,11 @@ datasource_required: resource_required: name: "test_name" +read_only: + - "pc_tag" + - "scope" + - "segment" + all: optimize_wan_bandwidth: "no" annotation: "annotation" diff --git a/gen/testvars/fvESg.yaml b/gen/testvars/fvESg.yaml index d17f2e7a8..6307cd0c2 100644 --- a/gen/testvars/fvESg.yaml +++ b/gen/testvars/fvESg.yaml @@ -26,6 +26,7 @@ resource_required: read_only: - "pc_tag" + - "scope" all: annotation: "annotation" diff --git a/internal/provider/data_source_aci_application_epg.go b/internal/provider/data_source_aci_application_epg.go index 33b51356d..d52f35a4a 100644 --- a/internal/provider/data_source_aci_application_epg.go +++ b/internal/provider/data_source_aci_application_epg.go @@ -218,6 +218,10 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Application EPG object.`, + }, "admin_state": schema.StringAttribute{ Computed: true, MarkdownDescription: `Withdraw AEPg Configuration from all Nodes in the Fabric.`, diff --git a/internal/provider/data_source_aci_application_epg_test.go b/internal/provider/data_source_aci_application_epg_test.go index e8d592126..828dc3dc1 100644 --- a/internal/provider/data_source_aci_application_epg_test.go +++ b/internal/provider/data_source_aci_application_epg_test.go @@ -37,6 +37,7 @@ func TestAccDataSourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("data.aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("data.aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("data.aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("data.aci_application_epg.test", "scope"), ), }, { diff --git a/internal/provider/data_source_aci_bridge_domain.go b/internal/provider/data_source_aci_bridge_domain.go index a19d8bd7e..f086dc7b6 100644 --- a/internal/provider/data_source_aci_bridge_domain.go +++ b/internal/provider/data_source_aci_bridge_domain.go @@ -249,6 +249,18 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "pc_tag": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The classification tag used for policy enforcement and zoning.`, + }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Bridge Domain object.`, + }, + "segment": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The segment ID (L2-VNI) of the Bridge Domain object.`, + }, "bridge_domain_type": schema.StringAttribute{ Computed: true, MarkdownDescription: `The domain type of the Bridge Domain object.`, diff --git a/internal/provider/data_source_aci_bridge_domain_test.go b/internal/provider/data_source_aci_bridge_domain_test.go index d4d6d3953..9b016bab4 100644 --- a/internal/provider/data_source_aci_bridge_domain_test.go +++ b/internal/provider/data_source_aci_bridge_domain_test.go @@ -52,6 +52,9 @@ func TestAccDataSourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("data.aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("data.aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("data.aci_bridge_domain.test", "segment"), ), }, { diff --git a/internal/provider/data_source_aci_endpoint_security_group.go b/internal/provider/data_source_aci_endpoint_security_group.go index 7bb530f56..083ea3603 100644 --- a/internal/provider/data_source_aci_endpoint_security_group.go +++ b/internal/provider/data_source_aci_endpoint_security_group.go @@ -127,6 +127,10 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Endpoint Security Group object.`, + }, "admin_state": schema.StringAttribute{ Computed: true, MarkdownDescription: `Withdraw the ESG configuration from all nodes in the fabric.`, diff --git a/internal/provider/data_source_aci_endpoint_security_group_test.go b/internal/provider/data_source_aci_endpoint_security_group_test.go index 406d35735..c73541f5a 100644 --- a/internal/provider/data_source_aci_endpoint_security_group_test.go +++ b/internal/provider/data_source_aci_endpoint_security_group_test.go @@ -32,6 +32,7 @@ func TestAccDataSourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("data.aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("data.aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("data.aci_endpoint_security_group.test", "scope"), ), }, { diff --git a/internal/provider/resource_aci_application_epg.go b/internal/provider/resource_aci_application_epg.go index 9b368b01f..ca4fb350f 100644 --- a/internal/provider/resource_aci_application_epg.go +++ b/internal/provider/resource_aci_application_epg.go @@ -62,6 +62,7 @@ type FvAEPgResourceModel struct { PcTag types.String `tfsdk:"pc_tag"` PrefGrMemb types.String `tfsdk:"preferred_group_member"` Prio customTypes.FvAEPgPrioStringValue `tfsdk:"priority"` + Scope types.String `tfsdk:"scope"` Shutdown types.String `tfsdk:"admin_state"` FvCrtrn types.Object `tfsdk:"epg_useg_block_statement"` FvRsAEPgMonPol types.Object `tfsdk:"relation_to_application_epg_monitoring_policy"` @@ -127,6 +128,7 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { PcTag: basetypes.NewStringNull(), PrefGrMemb: basetypes.NewStringNull(), Prio: customTypes.NewFvAEPgPrioStringNull(), + Scope: basetypes.NewStringNull(), Shutdown: basetypes.NewStringNull(), FvCrtrn: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, @@ -1994,6 +1996,7 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St PcTag: basetypes.NewStringNull(), PrefGrMemb: priorStateData.PrefGrMemb, Prio: customTypes.FvAEPgPrioStringValue{StringValue: priorStateData.Prio}, + Scope: basetypes.NewStringNull(), Shutdown: priorStateData.Shutdown, DeprecatedExceptionTag: priorStateData.ExceptionTag, DeprecatedFloodOnEncap: priorStateData.FloodOnEncap, @@ -4002,6 +4005,10 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Application EPG object.`, + }, "admin_state": schema.StringAttribute{ Optional: true, Computed: true, @@ -6556,6 +6563,9 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if attributeName == "prio" { readData.Prio = customTypes.NewFvAEPgPrioStringValue(attributeValue.(string)) } + if attributeName == "scope" { + readData.Scope = basetypes.NewStringValue(attributeValue.(string)) + } if attributeName == "shutdown" { readData.Shutdown = basetypes.NewStringValue(attributeValue.(string)) } diff --git a/internal/provider/resource_aci_application_epg_test.go b/internal/provider/resource_aci_application_epg_test.go index 0a54c0421..1a69502c7 100644 --- a/internal/provider/resource_aci_application_epg_test.go +++ b/internal/provider/resource_aci_application_epg_test.go @@ -55,6 +55,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.allow_test", "has_multicast_source", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "scope"), ), }, }, @@ -114,6 +115,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "pc_tag"), resource.TestCheckResourceAttrSet("aci_application_epg.allow_test_2", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_application_epg.allow_test_2", "scope"), ), }, }, @@ -144,6 +147,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Update with all config and verify default APIC values @@ -166,7 +170,10 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_application_epg.test", "scope", "0")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Update with minimum config and verify config is unchanged @@ -176,6 +183,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Update with empty strings config or default value @@ -199,6 +207,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Import testing @@ -228,6 +237,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.key", "key_1"), @@ -391,6 +401,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.key", "key_1"), @@ -815,6 +826,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "1"), @@ -1026,6 +1038,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), @@ -1162,6 +1175,7 @@ resource "aci_application_epg" "test" { useg_epg = "no" admin_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "no" : null has_multicast_source = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "no" : null + scope = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "0" : null } ` diff --git a/internal/provider/resource_aci_bridge_domain.go b/internal/provider/resource_aci_bridge_domain.go index 07dd05f4d..74fb8c445 100644 --- a/internal/provider/resource_aci_bridge_domain.go +++ b/internal/provider/resource_aci_bridge_domain.go @@ -68,6 +68,9 @@ type FvBDResourceModel struct { NameAlias types.String `tfsdk:"name_alias"` OwnerKey types.String `tfsdk:"owner_key"` OwnerTag types.String `tfsdk:"owner_tag"` + PcTag types.String `tfsdk:"pc_tag"` + Scope types.String `tfsdk:"scope"` + Seg types.String `tfsdk:"segment"` Type types.String `tfsdk:"bridge_domain_type"` UnicastRoute types.String `tfsdk:"unicast_routing"` UnkMacUcastAct types.String `tfsdk:"l2_unknown_unicast_flooding"` @@ -145,6 +148,9 @@ func getEmptyFvBDResourceModel() *FvBDResourceModel { NameAlias: basetypes.NewStringNull(), OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), + PcTag: basetypes.NewStringNull(), + Scope: basetypes.NewStringNull(), + Seg: basetypes.NewStringNull(), Type: basetypes.NewStringNull(), UnicastRoute: basetypes.NewStringNull(), UnkMacUcastAct: basetypes.NewStringNull(), @@ -1633,6 +1639,9 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat NameAlias: priorStateData.NameAlias, OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), + PcTag: basetypes.NewStringNull(), + Scope: basetypes.NewStringNull(), + Seg: basetypes.NewStringNull(), Type: priorStateData.Type, UnicastRoute: priorStateData.UnicastRoute, UnkMacUcastAct: priorStateData.UnkMacUcastAct, @@ -3300,6 +3309,18 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "pc_tag": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The classification tag used for policy enforcement and zoning.`, + }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Bridge Domain object.`, + }, + "segment": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The segment ID (L2-VNI) of the Bridge Domain object.`, + }, "bridge_domain_type": schema.StringAttribute{ Optional: true, Computed: true, @@ -3387,6 +3408,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Legacy Mode object.`, }, "description": schema.StringAttribute{ @@ -3395,6 +3417,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The description of the Legacy Mode object.`, }, "encapsulation": schema.StringAttribute{ @@ -3403,6 +3426,9 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The VLAN or VXLAN encapsulation of the Legacy Mode object.`, }, "name": schema.StringAttribute{ @@ -3411,6 +3437,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Legacy Mode object.`, }, "name_alias": schema.StringAttribute{ @@ -3419,6 +3446,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name alias of the Legacy Mode object.`, }, "owner_key": schema.StringAttribute{ @@ -3427,6 +3455,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`, }, "owner_tag": schema.StringAttribute{ @@ -3435,6 +3464,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3447,17 +3477,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3473,17 +3511,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3506,6 +3552,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Rogue Coop Exception object.`, }, "description": schema.StringAttribute{ @@ -3514,13 +3561,18 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The description of the Rogue Coop Exception object.`, }, "mac": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The MAC address of the Rogue Coop Exception object.`, }, "name": schema.StringAttribute{ @@ -3529,6 +3581,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Rogue Coop Exception object.`, }, "name_alias": schema.StringAttribute{ @@ -3537,6 +3590,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name alias of the Rogue Coop Exception object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3549,17 +3603,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3575,17 +3637,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3608,6 +3678,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Monitoring Policy object.`, }, "monitoring_policy_name": schema.StringAttribute{ @@ -3616,6 +3687,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Monitoring Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3628,17 +3700,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3654,17 +3734,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3686,6 +3774,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To First Hop Security Policy object.`, }, "first_hop_security_policy_name": schema.StringAttribute{ @@ -3694,6 +3783,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the First Hop Security Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3706,17 +3796,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3732,17 +3830,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3764,6 +3870,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Neighbor Discovery Interface Policy object.`, }, "neighbor_discovery_interface_policy_name": schema.StringAttribute{ @@ -3772,6 +3879,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Neighbor Discovery Interface Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3784,17 +3892,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3810,17 +3926,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3843,10 +3967,12 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object.`, }, "filter_type": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, @@ -3857,10 +3983,14 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r MarkdownDescription: `The filter type of the NetFlow Monitor Policy object.`, }, "netflow_monitor_policy_name": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The name of the NetFlow Monitor Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3873,17 +4003,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3899,17 +4037,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3933,13 +4079,18 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To L3 Outside object.`, }, "l3_outside_name": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The name of the L3 Outside object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3952,17 +4103,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3978,17 +4137,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4011,6 +4178,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Route Control Profile object.`, }, "l3_outside_name": schema.StringAttribute{ @@ -4019,6 +4187,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the L3 Outside object.`, }, "route_control_profile_name": schema.StringAttribute{ @@ -4027,6 +4196,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Route Control Profile object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4039,17 +4209,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4065,17 +4243,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4097,6 +4283,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Dhcp Relay Policy object.`, }, "dhcp_relay_policy_name": schema.StringAttribute{ @@ -4105,6 +4292,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the DHCP Relay Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4117,17 +4305,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4143,17 +4339,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4175,6 +4379,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To End Point Retention Policy object.`, }, "resolve_action": schema.StringAttribute{ @@ -4194,6 +4399,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Endpoint Retention Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4206,17 +4412,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4232,17 +4446,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4264,6 +4486,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To VRF object.`, }, "vrf_name": schema.StringAttribute{ @@ -4272,6 +4495,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the VRF object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4284,17 +4508,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4310,17 +4542,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4342,6 +4582,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To IGMP Snooping Policy object.`, }, "igmp_snooping_policy_name": schema.StringAttribute{ @@ -4350,6 +4591,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the IGMP Snooping Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4362,17 +4604,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4388,17 +4638,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4420,6 +4678,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To MLD Snooping Policy object.`, }, "mld_snooping_policy_name": schema.StringAttribute{ @@ -4428,6 +4687,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the MLD Snooping Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4440,17 +4700,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4466,17 +4734,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4494,17 +4770,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4520,17 +4804,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4944,6 +5236,15 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if attributeName == "ownerTag" { readData.OwnerTag = basetypes.NewStringValue(attributeValue.(string)) } + if attributeName == "pcTag" { + readData.PcTag = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "scope" { + readData.Scope = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "seg" { + readData.Seg = basetypes.NewStringValue(attributeValue.(string)) + } if attributeName == "type" { readData.Type = basetypes.NewStringValue(attributeValue.(string)) } diff --git a/internal/provider/resource_aci_bridge_domain_test.go b/internal/provider/resource_aci_bridge_domain_test.go index dff02c20a..facb2b5a1 100644 --- a/internal/provider/resource_aci_bridge_domain_test.go +++ b/internal/provider/resource_aci_bridge_domain_test.go @@ -83,6 +83,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "virtual_mac_address", "not-applicable"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "segment"), ), }, }, @@ -169,6 +172,12 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "virtual_mac_address", "not-applicable"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test_2", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test_2", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "segment"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test_2", "segment"), ), }, }, @@ -214,6 +223,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Update with all config and verify default APIC values @@ -252,6 +264,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "no")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "00:22:BD:F8:19:FB"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Update with minimum config and verify config is unchanged @@ -260,6 +275,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_bridge_domain.test", "name", "test_name"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Update with empty strings config or default value @@ -298,6 +316,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Import testing @@ -342,6 +363,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.1.key", "key_1"), @@ -415,6 +439,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Config: testConfigFvBDChildrenRemoveFromConfigDependencyWithFvTenant + testConfigDataSourceSystem, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.1.key", "key_1"), @@ -642,6 +669,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Config: testConfigFvBDChildrenRemoveOneDependencyWithFvTenant + testConfigDataSourceSystem, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "1"), @@ -790,6 +820,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Config: testConfigFvBDChildrenRemoveAllDependencyWithFvTenant + testConfigDataSourceSystem, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.#", "0"), diff --git a/internal/provider/resource_aci_endpoint_security_group.go b/internal/provider/resource_aci_endpoint_security_group.go index d5ef1ef78..8a82993fa 100644 --- a/internal/provider/resource_aci_endpoint_security_group.go +++ b/internal/provider/resource_aci_endpoint_security_group.go @@ -57,6 +57,7 @@ type FvESgResourceModel struct { PcEnfPref types.String `tfsdk:"intra_esg_isolation"` PcTag types.String `tfsdk:"pc_tag"` PrefGrMemb types.String `tfsdk:"preferred_group_member"` + Scope types.String `tfsdk:"scope"` Shutdown types.String `tfsdk:"admin_state"` FvRsCons types.Set `tfsdk:"relation_to_consumed_contracts"` FvRsConsIf types.Set `tfsdk:"relation_to_imported_contracts"` @@ -93,6 +94,7 @@ func getEmptyFvESgResourceModel() *FvESgResourceModel { PcEnfPref: basetypes.NewStringNull(), PcTag: basetypes.NewStringNull(), PrefGrMemb: basetypes.NewStringNull(), + Scope: basetypes.NewStringNull(), Shutdown: basetypes.NewStringNull(), FvRsCons: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -895,6 +897,7 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta PcEnfPref: priorStateData.PcEnfPref, PcTag: basetypes.NewStringNull(), PrefGrMemb: priorStateData.PrefGrMemb, + Scope: basetypes.NewStringNull(), Shutdown: basetypes.NewStringNull(), DeprecatedMatchT: priorStateData.MatchT, DeprecatedParentDn: priorStateData.ParentDn, @@ -1763,6 +1766,10 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Endpoint Security Group object.`, + }, "admin_state": schema.StringAttribute{ Optional: true, Computed: true, @@ -2860,6 +2867,9 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if attributeName == "prefGrMemb" { readData.PrefGrMemb = basetypes.NewStringValue(attributeValue.(string)) } + if attributeName == "scope" { + readData.Scope = basetypes.NewStringValue(attributeValue.(string)) + } if attributeName == "shutdown" { readData.Shutdown = basetypes.NewStringValue(attributeValue.(string)) } diff --git a/internal/provider/resource_aci_endpoint_security_group_test.go b/internal/provider/resource_aci_endpoint_security_group_test.go index 2a79ac864..734522701 100644 --- a/internal/provider/resource_aci_endpoint_security_group_test.go +++ b/internal/provider/resource_aci_endpoint_security_group_test.go @@ -42,6 +42,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "scope"), ), }, }, @@ -91,6 +92,8 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "pc_tag"), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test_2", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test_2", "scope"), ), }, }, @@ -116,6 +119,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Update with all config and verify default APIC values @@ -134,6 +138,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Update with minimum config and verify config is unchanged @@ -143,6 +148,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "name", "test_name"), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Update with empty strings config or default value @@ -161,6 +167,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Import testing @@ -185,6 +192,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.1.key", "key_1"), @@ -242,6 +250,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.1.key", "key_1"), @@ -405,6 +414,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "1"), @@ -476,6 +486,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.#", "0"),