diff --git a/docs/data-sources/remote_site_id_mappings.md b/docs/data-sources/remote_site_id_mappings.md index 1c38e6ee2..9396fc980 100644 --- a/docs/data-sources/remote_site_id_mappings.md +++ b/docs/data-sources/remote_site_id_mappings.md @@ -38,7 +38,7 @@ Data source for Remote Site Id Mappings data "aci_remote_site_id_mappings" "example_associated_site" { parent_dn = aci_associated_site.example.id - site_id = "0" + site_id = "100" } ``` diff --git a/docs/resources/associated_site.md b/docs/resources/associated_site.md index 33fef8cea..18c4bbbb1 100644 --- a/docs/resources/associated_site.md +++ b/docs/resources/associated_site.md @@ -62,7 +62,7 @@ resource "aci_associated_site" "full_example_application_epg" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - site_id = "0" + site_id = "100" annotations = [ { key = "key_0" @@ -85,7 +85,7 @@ resource "aci_associated_site" "full_example_bridge_domain" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - site_id = "0" + site_id = "100" annotations = [ { key = "key_0" diff --git a/docs/resources/remote_site_id_mappings.md b/docs/resources/remote_site_id_mappings.md index 75f181ac4..0b2db34e7 100644 --- a/docs/resources/remote_site_id_mappings.md +++ b/docs/resources/remote_site_id_mappings.md @@ -41,8 +41,10 @@ The configuration snippet below creates a Remote Site Id Mappings with only requ ```hcl resource "aci_remote_site_id_mappings" "example_associated_site" { - parent_dn = aci_associated_site.example.id - site_id = "0" + parent_dn = aci_associated_site.example.id + remote_vrf_pc_tag = "2818057" + remote_pc_tag = "16386" + site_id = "100" } ``` @@ -60,9 +62,9 @@ resource "aci_remote_site_id_mappings" "full_example_associated_site" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - remote_vrf_pc_tag = "remote_vrf_pc_tag" - remote_pc_tag = "remote_pc_tag" - site_id = "0" + remote_vrf_pc_tag = "2818057" + remote_pc_tag = "16386" + site_id = "100" annotations = [ { key = "key_0" @@ -87,6 +89,8 @@ All examples for the Remote Site Id Mappings resource can be found in the [examp * `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources: - [aci_associated_site](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/associated_site) ([fvSiteAssociated](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvSiteAssociated/overview)) +* `remote_vrf_pc_tag` (remoteCtxPcTag) - (string) Remote context's *pcTag*, mapping required for default route case. +* `remote_pc_tag` (remotePcTag) - (string) Remote Class ID. * `site_id` (siteId) - (string) A number between 0 and 1000 to identify the remote site being associated with the primary site. ### Read-Only ### @@ -102,8 +106,6 @@ All examples for the Remote Site Id Mappings resource can be found in the [examp * `name_alias` (nameAlias) - (string) The name alias of the Remote Site Id Mappings 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. -* `remote_vrf_pc_tag` (remoteCtxPcTag) - (string) Remote context's *pcTag*, mapping required for default route case. -* `remote_pc_tag` (remotePcTag) - (string) Remote Class ID. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. diff --git a/examples/data-sources/aci_remote_site_id_mappings/data-source.tf b/examples/data-sources/aci_remote_site_id_mappings/data-source.tf index 6edb084d5..82cb8b869 100644 --- a/examples/data-sources/aci_remote_site_id_mappings/data-source.tf +++ b/examples/data-sources/aci_remote_site_id_mappings/data-source.tf @@ -1,5 +1,5 @@ data "aci_remote_site_id_mappings" "example_associated_site" { parent_dn = aci_associated_site.example.id - site_id = "0" + site_id = "100" } diff --git a/examples/resources/aci_associated_site/resource-all-attributes.tf b/examples/resources/aci_associated_site/resource-all-attributes.tf index 65e585a87..5d64997ff 100644 --- a/examples/resources/aci_associated_site/resource-all-attributes.tf +++ b/examples/resources/aci_associated_site/resource-all-attributes.tf @@ -7,7 +7,7 @@ resource "aci_associated_site" "full_example_application_epg" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - site_id = "0" + site_id = "100" annotations = [ { key = "key_0" @@ -30,7 +30,7 @@ resource "aci_associated_site" "full_example_bridge_domain" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - site_id = "0" + site_id = "100" annotations = [ { key = "key_0" diff --git a/examples/resources/aci_remote_site_id_mappings/resource-all-attributes.tf b/examples/resources/aci_remote_site_id_mappings/resource-all-attributes.tf index 4aa7b4ec9..879afd77c 100644 --- a/examples/resources/aci_remote_site_id_mappings/resource-all-attributes.tf +++ b/examples/resources/aci_remote_site_id_mappings/resource-all-attributes.tf @@ -7,9 +7,9 @@ resource "aci_remote_site_id_mappings" "full_example_associated_site" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - remote_vrf_pc_tag = "remote_vrf_pc_tag" - remote_pc_tag = "remote_pc_tag" - site_id = "0" + remote_vrf_pc_tag = "2818057" + remote_pc_tag = "16386" + site_id = "100" annotations = [ { key = "key_0" diff --git a/examples/resources/aci_remote_site_id_mappings/resource.tf b/examples/resources/aci_remote_site_id_mappings/resource.tf index 8aecb5ea3..52a5f432e 100644 --- a/examples/resources/aci_remote_site_id_mappings/resource.tf +++ b/examples/resources/aci_remote_site_id_mappings/resource.tf @@ -1,5 +1,7 @@ resource "aci_remote_site_id_mappings" "example_associated_site" { - parent_dn = aci_associated_site.example.id - site_id = "0" + parent_dn = aci_associated_site.example.id + remote_vrf_pc_tag = "2818057" + remote_pc_tag = "16386" + site_id = "100" } diff --git a/gen/definitions/properties.yaml b/gen/definitions/properties.yaml index b87deda9b..d411209f6 100644 --- a/gen/definitions/properties.yaml +++ b/gen/definitions/properties.yaml @@ -226,11 +226,11 @@ fvSiteAssociated: - "site_id" test_values: all: - site_id: "0" + site_id: "100" default: - site_id: "0" + site_id: "100" resource_required: - site_id: "0" + site_id: "100" datasource_required: - "site_id" parents: @@ -247,21 +247,28 @@ fvRemoteId: remote_ctx_pc_tag: "remote_vrf_pc_tag" documentation: siteId: "A number between 0 and 1000 to identify the remote site being associated with the primary site" + default_values: + siteId: "100" + remote_ctx_pc_tag: "2818057" + remote_pc_tag: "16386" + resource_required: + - "remoteCtxPcTag" + - "remotePcTag" test_values: all: - site_id: "0" + site_id: "100" + remote_vrf_pc_tag: "2818057" + remote_pc_tag: "16386" default: - site_id: "0" + site_id: "100" + remote_vrf_pc_tag: "2818057" + remote_pc_tag: "16386" resource_required: - site_id: "0" - datasource_required: - site_id: "0" - resource_required: - - "site_id" - datasource_required: - - "site_id" - default_values: - siteId: "0" + site_id: "100" + remote_vrf_pc_tag: "2818057" + remote_pc_tag: "16386" + datasource_non_existing: + site_id: "102" parents: - class_name: "fvSiteAssociated" parent_dependency: "fvCtx" diff --git a/gen/testvars/fvRemoteId.yaml b/gen/testvars/fvRemoteId.yaml index 21696eb67..00cd25886 100644 --- a/gen/testvars/fvRemoteId.yaml +++ b/gen/testvars/fvRemoteId.yaml @@ -9,18 +9,20 @@ default: name_alias: "" owner_key: "" owner_tag: "" - remote_vrf_pc_tag: "" - remote_pc_tag: "" - site_id: "0" + remote_vrf_pc_tag: "2818057" + remote_pc_tag: "16386" + site_id: "100" datasource_non_existing: - site_id: "non_existing_site_id" + site_id: "102" datasource_required: - site_id: "0" + site_id: "test_site_id" resource_required: - site_id: "0" + remote_vrf_pc_tag: "2818057" + remote_pc_tag: "16386" + site_id: "100" all: annotation: "annotation" @@ -29,9 +31,9 @@ all: name_alias: "name_alias" owner_key: "owner_key" owner_tag: "owner_tag" - remote_vrf_pc_tag: "remote_vrf_pc_tag" - remote_pc_tag: "remote_pc_tag" - site_id: "0" + remote_vrf_pc_tag: "2818057" + remote_pc_tag: "16386" + site_id: "100" children: annotations: diff --git a/gen/testvars/fvSiteAssociated.yaml b/gen/testvars/fvSiteAssociated.yaml index 5f0da69da..e19ed408f 100644 --- a/gen/testvars/fvSiteAssociated.yaml +++ b/gen/testvars/fvSiteAssociated.yaml @@ -9,7 +9,7 @@ default: name_alias: "" owner_key: "" owner_tag: "" - site_id: "0" + site_id: "100" all: @@ -19,7 +19,7 @@ all: name_alias: "name_alias" owner_key: "owner_key" owner_tag: "owner_tag" - site_id: "0" + site_id: "100" children: annotations: diff --git a/internal/provider/data_source_aci_associated_site_test.go b/internal/provider/data_source_aci_associated_site_test.go index 6729e0b32..5976fb5ee 100644 --- a/internal/provider/data_source_aci_associated_site_test.go +++ b/internal/provider/data_source_aci_associated_site_test.go @@ -27,7 +27,7 @@ func TestAccDataSourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("data.aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("data.aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("data.aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("data.aci_associated_site.test", "site_id", "100"), ), }, { @@ -53,7 +53,7 @@ func TestAccDataSourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("data.aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("data.aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("data.aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("data.aci_associated_site.test", "site_id", "100"), ), }, { diff --git a/internal/provider/data_source_aci_remote_site_id_mappings_test.go b/internal/provider/data_source_aci_remote_site_id_mappings_test.go index 7c30258ec..5ece19977 100644 --- a/internal/provider/data_source_aci_remote_site_id_mappings_test.go +++ b/internal/provider/data_source_aci_remote_site_id_mappings_test.go @@ -21,16 +21,16 @@ func TestAccDataSourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { Config: testConfigFvRemoteIdDataSourceDependencyWithFvSiteAssociated, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "site_id", "test_site_id"), resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "description", ""), resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "name", ""), resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "name_alias", ""), resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "owner_tag", ""), - resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "remote_pc_tag", ""), - resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", ""), - resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("data.aci_remote_site_id_mappings.test", "site_id", "100"), ), }, { @@ -44,7 +44,7 @@ func TestAccDataSourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { const testConfigFvRemoteIdDataSourceDependencyWithFvSiteAssociated = testConfigFvRemoteIdMinDependencyWithFvSiteAssociated + ` data "aci_remote_site_id_mappings" "test" { parent_dn = aci_associated_site.test.id - site_id = "0" + site_id = "test_site_id" depends_on = [aci_remote_site_id_mappings.test] } ` @@ -52,7 +52,7 @@ data "aci_remote_site_id_mappings" "test" { const testConfigFvRemoteIdNotExistingFvSiteAssociated = testConfigFvRemoteIdMinDependencyWithFvSiteAssociated + ` data "aci_remote_site_id_mappings" "test_non_existing" { parent_dn = aci_associated_site.test.id - site_id = "non_existing_site_id" + site_id = "102" depends_on = [aci_remote_site_id_mappings.test] } ` diff --git a/internal/provider/resource_aci_associated_site_test.go b/internal/provider/resource_aci_associated_site_test.go index 7b7d316da..30ef61ccb 100644 --- a/internal/provider/resource_aci_associated_site_test.go +++ b/internal/provider/resource_aci_associated_site_test.go @@ -27,7 +27,7 @@ func TestAccResourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Update with all config and verify default APIC values @@ -41,7 +41,7 @@ func TestAccResourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", "name_alias"), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", "owner_key"), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", "owner_tag"), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Update with minimum config and verify config is unchanged @@ -61,7 +61,7 @@ func TestAccResourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Import testing @@ -76,7 +76,7 @@ func TestAccResourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Update with children @@ -90,7 +90,7 @@ func TestAccResourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.1.key", "key_1"), @@ -113,7 +113,7 @@ func TestAccResourceFvSiteAssociatedWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.1.key", "key_1"), @@ -183,7 +183,7 @@ func TestAccResourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Update with all config and verify default APIC values @@ -197,7 +197,7 @@ func TestAccResourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", "name_alias"), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", "owner_key"), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", "owner_tag"), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Update with minimum config and verify config is unchanged @@ -217,7 +217,7 @@ func TestAccResourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Import testing @@ -232,7 +232,7 @@ func TestAccResourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), ), }, // Update with children @@ -246,7 +246,7 @@ func TestAccResourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.1.key", "key_1"), @@ -269,7 +269,7 @@ func TestAccResourceFvSiteAssociatedWithFvBD(t *testing.T) { resource.TestCheckResourceAttr("aci_associated_site.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_associated_site.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_associated_site.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_associated_site.test", "annotations.1.key", "key_1"), @@ -338,7 +338,7 @@ resource "aci_associated_site" "test" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - site_id = "0" + site_id = "100" } ` @@ -351,7 +351,7 @@ resource "aci_associated_site" "test" { name_alias = "" owner_key = "" owner_tag = "" - site_id = "0" + site_id = "100" } ` const testConfigFvSiteAssociatedChildrenDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvTenant + ` @@ -427,7 +427,7 @@ resource "aci_associated_site" "test" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - site_id = "0" + site_id = "100" } ` @@ -440,7 +440,7 @@ resource "aci_associated_site" "test" { name_alias = "" owner_key = "" owner_tag = "" - site_id = "0" + site_id = "100" } ` const testConfigFvSiteAssociatedChildrenDependencyWithFvBD = testConfigFvBDMinDependencyWithFvAp + ` diff --git a/internal/provider/resource_aci_remote_site_id_mappings.go b/internal/provider/resource_aci_remote_site_id_mappings.go index 483e07149..3d7d12a28 100644 --- a/internal/provider/resource_aci_remote_site_id_mappings.go +++ b/internal/provider/resource_aci_remote_site_id_mappings.go @@ -150,16 +150,14 @@ func (r *FvRemoteIdResource) Schema(ctx context.Context, req resource.SchemaRequ MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, "remote_vrf_pc_tag": schema.StringAttribute{ - Optional: true, - Computed: true, + Required: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, MarkdownDescription: `Remote context's *pcTag*, mapping required for default route case.`, }, "remote_pc_tag": schema.StringAttribute{ - Optional: true, - Computed: true, + Required: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, diff --git a/internal/provider/resource_aci_remote_site_id_mappings_test.go b/internal/provider/resource_aci_remote_site_id_mappings_test.go index 74ead1cfa..6cfa5ecd6 100644 --- a/internal/provider/resource_aci_remote_site_id_mappings_test.go +++ b/internal/provider/resource_aci_remote_site_id_mappings_test.go @@ -27,9 +27,9 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), ), }, // Update with all config and verify default APIC values @@ -43,9 +43,9 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name_alias", "name_alias"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_key", "owner_key"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_tag", "owner_tag"), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "remote_pc_tag"), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "remote_vrf_pc_tag"), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), ), }, // Update with minimum config and verify config is unchanged @@ -53,7 +53,9 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { Config: testConfigFvRemoteIdMinDependencyWithFvSiteAssociated, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), ), }, // Update with empty strings config or default value @@ -61,15 +63,15 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { Config: testConfigFvRemoteIdResetDependencyWithFvSiteAssociated, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "description", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", ""), ), }, // Import testing @@ -78,15 +80,15 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { ImportState: true, ImportStateVerify: true, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "description", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", ""), ), }, // Update with children @@ -94,15 +96,15 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { Config: testConfigFvRemoteIdChildrenDependencyWithFvSiteAssociated, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "description", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotations.1.key", "key_1"), @@ -119,15 +121,15 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { ImportState: true, ImportStateVerify: true, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "0"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", "16386"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", "2818057"), + resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "site_id", "100"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "description", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_pc_tag", ""), - resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "remote_vrf_pc_tag", ""), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_remote_site_id_mappings.test", "annotations.1.key", "key_1"), @@ -184,7 +186,9 @@ func TestAccResourceFvRemoteIdWithFvSiteAssociated(t *testing.T) { const testConfigFvRemoteIdMinDependencyWithFvSiteAssociated = testConfigFvSiteAssociatedMinDependencyWithFvCtx + ` resource "aci_remote_site_id_mappings" "test" { parent_dn = aci_associated_site.test.id - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" } ` @@ -197,9 +201,9 @@ resource "aci_remote_site_id_mappings" "test" { name_alias = "name_alias" owner_key = "owner_key" owner_tag = "owner_tag" - remote_pc_tag = "remote_pc_tag" - remote_vrf_pc_tag = "remote_vrf_pc_tag" - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" } ` @@ -212,15 +216,17 @@ resource "aci_remote_site_id_mappings" "test" { name_alias = "" owner_key = "" owner_tag = "" - remote_pc_tag = "" - remote_vrf_pc_tag = "" - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" } ` const testConfigFvRemoteIdChildrenDependencyWithFvSiteAssociated = testConfigFvSiteAssociatedMinDependencyWithFvCtx + ` resource "aci_remote_site_id_mappings" "test" { parent_dn = aci_associated_site.test.id - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" annotations = [ { key = "key_0" @@ -247,14 +253,18 @@ resource "aci_remote_site_id_mappings" "test" { const testConfigFvRemoteIdChildrenRemoveFromConfigDependencyWithFvSiteAssociated = testConfigFvSiteAssociatedMinDependencyWithFvCtx + ` resource "aci_remote_site_id_mappings" "test" { parent_dn = aci_associated_site.test.id - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" } ` const testConfigFvRemoteIdChildrenRemoveOneDependencyWithFvSiteAssociated = testConfigFvSiteAssociatedMinDependencyWithFvCtx + ` resource "aci_remote_site_id_mappings" "test" { parent_dn = aci_associated_site.test.id - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" annotations = [ { key = "key_1" @@ -273,7 +283,9 @@ resource "aci_remote_site_id_mappings" "test" { const testConfigFvRemoteIdChildrenRemoveAllDependencyWithFvSiteAssociated = testConfigFvSiteAssociatedMinDependencyWithFvCtx + ` resource "aci_remote_site_id_mappings" "test" { parent_dn = aci_associated_site.test.id - site_id = "0" + remote_pc_tag = "16386" + remote_vrf_pc_tag = "2818057" + site_id = "100" annotations = [] tags = [] }