diff --git a/aci/data_source_aci_rtctrlprofile.go b/aci/data_source_aci_rtctrlprofile.go deleted file mode 100644 index 983c730ff..000000000 --- a/aci/data_source_aci_rtctrlprofile.go +++ /dev/null @@ -1,73 +0,0 @@ -package aci - -import ( - "context" - "fmt" - - "github.com/ciscoecosystem/aci-go-client/v2/client" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceAciRouteControlProfile() *schema.Resource { - return &schema.Resource{ - - ReadContext: dataSourceAciRouteControlProfileRead, - - SchemaVersion: 1, - - Schema: AppendBaseAttrSchema(map[string]*schema.Schema{ - "parent_dn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "annotation": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "name_alias": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "route_control_profile_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }), - } -} - -func dataSourceAciRouteControlProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - aciClient := m.(*client.Client) - - name := d.Get("name").(string) - - rn := fmt.Sprintf("prof-%s", name) - ParentDn := d.Get("parent_dn").(string) - - dn := fmt.Sprintf("%s/%s", ParentDn, rn) - - rtctrlProfile, err := getRemoteRouteControlProfile(aciClient, dn) - - if err != nil { - return diag.FromErr(err) - } - - d.SetId(dn) - _, err = setRouteControlProfileAttributes(rtctrlProfile, d) - if err != nil { - return diag.FromErr(err) - } - return nil -} diff --git a/aci/data_source_aci_rtctrlprofile_deprecated.go b/aci/data_source_aci_rtctrlprofile_deprecated.go deleted file mode 100644 index a7a892372..000000000 --- a/aci/data_source_aci_rtctrlprofile_deprecated.go +++ /dev/null @@ -1,44 +0,0 @@ -package aci - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceAciBgpRouteControlProfile() *schema.Resource { - return &schema.Resource{ - DeprecationMessage: "Use aci_route_control_profile data source instead", - ReadContext: dataSourceAciRouteControlProfileRead, - - SchemaVersion: 1, - - Schema: AppendBaseAttrSchema(map[string]*schema.Schema{ - "parent_dn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "annotation": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "name_alias": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "route_control_profile_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }), - } -} diff --git a/aci/provider.go b/aci/provider.go index cb28b97ce..57591feb6 100644 --- a/aci/provider.go +++ b/aci/provider.go @@ -229,8 +229,6 @@ func Provider() *schema.Provider { "aci_l3out_hsrp_interface_profile": resourceAciL3outHSRPInterfaceProfile(), "aci_ospf_timers": resourceAciOSPFTimersPolicy(), "aci_hsrp_interface_policy": resourceAciHSRPInterfacePolicy(), - "aci_route_control_profile": resourceAciRouteControlProfile(), - "aci_bgp_route_control_profile": resourceAciBgpRouteControlProfile(), "aci_l3out_hsrp_interface_group": resourceAciHSRPGroupProfile(), "aci_l3out_floating_svi": resourceAciVirtualLogicalInterfaceProfile(), "aci_l3out_hsrp_secondary_vip": resourceAciL3outHSRPSecondaryVIP(), @@ -483,8 +481,6 @@ func Provider() *schema.Provider { "aci_l3out_hsrp_interface_profile": dataSourceAciL3outHSRPInterfaceProfile(), "aci_ospf_timers": dataSourceAciOSPFTimersPolicy(), "aci_hsrp_interface_policy": dataSourceAciHSRPInterfacePolicy(), - "aci_bgp_route_control_profile": dataSourceAciBgpRouteControlProfile(), - "aci_route_control_profile": dataSourceAciRouteControlProfile(), "aci_l3out_hsrp_interface_group": dataSourceAciHSRPGroupProfile(), "aci_l3out_floating_svi": dataSourceAciVirtualLogicalInterfaceProfile(), "aci_l3out_hsrp_secondary_vip": dataSourceAciL3outHSRPSecondaryVIP(), diff --git a/aci/resource_aci_rtctrlprofile.go b/aci/resource_aci_rtctrlprofile.go deleted file mode 100644 index e7a02ba23..000000000 --- a/aci/resource_aci_rtctrlprofile.go +++ /dev/null @@ -1,224 +0,0 @@ -package aci - -import ( - "context" - "fmt" - "log" - - "github.com/ciscoecosystem/aci-go-client/v2/client" - "github.com/ciscoecosystem/aci-go-client/v2/models" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" -) - -func resourceAciRouteControlProfile() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceAciRouteControlProfileCreate, - UpdateContext: resourceAciRouteControlProfileUpdate, - ReadContext: resourceAciRouteControlProfileRead, - DeleteContext: resourceAciRouteControlProfileDelete, - - Importer: &schema.ResourceImporter{ - State: resourceAciRouteControlProfileImport, - }, - - SchemaVersion: 1, - - Schema: AppendBaseAttrSchema(map[string]*schema.Schema{ - "parent_dn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "name_alias": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "route_control_profile_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "global", - "combinable", - }, false), - }, - }), - } -} -func getRemoteRouteControlProfile(client *client.Client, dn string) (*models.RouteControlProfile, error) { - rtctrlProfileCont, err := client.Get(dn) - if err != nil { - return nil, err - } - - rtctrlProfile := models.RouteControlProfileFromContainer(rtctrlProfileCont) - - if rtctrlProfile.DistinguishedName == "" { - return nil, fmt.Errorf("Route Control Profile %s not found", dn) - } - - return rtctrlProfile, nil -} - -func setRouteControlProfileAttributes(rtctrlProfile *models.RouteControlProfile, d *schema.ResourceData) (*schema.ResourceData, error) { - dn := d.Id() - - d.SetId(rtctrlProfile.DistinguishedName) - d.Set("description", rtctrlProfile.Description) - if dn != rtctrlProfile.DistinguishedName { - d.Set("parent_dn", "") - } - rtctrlProfileMap, err := rtctrlProfile.ToMap() - if err != nil { - return d, err - } - - d.Set("parent_dn", GetParentDn(dn, fmt.Sprintf("/prof-%s", rtctrlProfileMap["name"]))) - d.Set("name", rtctrlProfileMap["name"]) - d.Set("annotation", rtctrlProfileMap["annotation"]) - d.Set("name_alias", rtctrlProfileMap["nameAlias"]) - d.Set("route_control_profile_type", rtctrlProfileMap["type"]) - - return d, nil -} - -func resourceAciRouteControlProfileImport(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { - log.Printf("[DEBUG] %s: Beginning Import", d.Id()) - aciClient := m.(*client.Client) - - dn := d.Id() - - rtctrlProfile, err := getRemoteRouteControlProfile(aciClient, dn) - - if err != nil { - return nil, err - } - schemaFilled, err := setRouteControlProfileAttributes(rtctrlProfile, d) - if err != nil { - return nil, err - } - log.Printf("[DEBUG] %s: Import finished successfully", d.Id()) - - return []*schema.ResourceData{schemaFilled}, nil -} - -func resourceAciRouteControlProfileCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - log.Printf("[DEBUG] RouteControlProfile: Beginning Creation") - aciClient := m.(*client.Client) - desc := d.Get("description").(string) - - name := d.Get("name").(string) - - ParentDn := d.Get("parent_dn").(string) - - rtctrlProfileAttr := models.RouteControlProfileAttributes{} - if Annotation, ok := d.GetOk("annotation"); ok { - rtctrlProfileAttr.Annotation = Annotation.(string) - } else { - rtctrlProfileAttr.Annotation = "{}" - } - if NameAlias, ok := d.GetOk("name_alias"); ok { - rtctrlProfileAttr.NameAlias = NameAlias.(string) - } - if RouteControlProfileType, ok := d.GetOk("route_control_profile_type"); ok { - rtctrlProfileAttr.RouteControlProfileType = RouteControlProfileType.(string) - } - rtctrlProfile := models.NewRouteControlProfile(fmt.Sprintf("prof-%s", name), ParentDn, desc, rtctrlProfileAttr) - - err := aciClient.Save(rtctrlProfile) - if err != nil { - return diag.FromErr(err) - } - - d.SetId(rtctrlProfile.DistinguishedName) - log.Printf("[DEBUG] %s: Creation finished successfully", d.Id()) - - return resourceAciRouteControlProfileRead(ctx, d, m) -} - -func resourceAciRouteControlProfileUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - log.Printf("[DEBUG] RouteControlProfile: Beginning Update") - - aciClient := m.(*client.Client) - desc := d.Get("description").(string) - - name := d.Get("name").(string) - - ParentDn := d.Get("parent_dn").(string) - - rtctrlProfileAttr := models.RouteControlProfileAttributes{} - if Annotation, ok := d.GetOk("annotation"); ok { - rtctrlProfileAttr.Annotation = Annotation.(string) - } else { - rtctrlProfileAttr.Annotation = "{}" - } - if NameAlias, ok := d.GetOk("name_alias"); ok { - rtctrlProfileAttr.NameAlias = NameAlias.(string) - } - if RouteControlProfileType, ok := d.GetOk("route_control_profile_type"); ok { - rtctrlProfileAttr.RouteControlProfileType = RouteControlProfileType.(string) - } - rtctrlProfile := models.NewRouteControlProfile(fmt.Sprintf("prof-%s", name), ParentDn, desc, rtctrlProfileAttr) - - rtctrlProfile.Status = "modified" - - err := aciClient.Save(rtctrlProfile) - - if err != nil { - return diag.FromErr(err) - } - - d.SetId(rtctrlProfile.DistinguishedName) - log.Printf("[DEBUG] %s: Update finished successfully", d.Id()) - - return resourceAciRouteControlProfileRead(ctx, d, m) - -} - -func resourceAciRouteControlProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - log.Printf("[DEBUG] %s: Beginning Read", d.Id()) - - aciClient := m.(*client.Client) - - dn := d.Id() - rtctrlProfile, err := getRemoteRouteControlProfile(aciClient, dn) - - if err != nil { - return errorForObjectNotFound(err, dn, d) - } - _, err = setRouteControlProfileAttributes(rtctrlProfile, d) - if err != nil { - d.SetId("") - return nil - } - log.Printf("[DEBUG] %s: Read finished successfully", d.Id()) - - return nil -} - -func resourceAciRouteControlProfileDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - log.Printf("[DEBUG] %s: Beginning Destroy", d.Id()) - - aciClient := m.(*client.Client) - dn := d.Id() - err := aciClient.DeleteByDn(dn, "rtctrlProfile") - if err != nil { - return diag.FromErr(err) - } - - log.Printf("[DEBUG] %s: Destroy finished successfully", d.Id()) - - d.SetId("") - return diag.FromErr(err) -} diff --git a/aci/resource_aci_rtctrlprofile_deprecated.go b/aci/resource_aci_rtctrlprofile_deprecated.go deleted file mode 100644 index df9232c01..000000000 --- a/aci/resource_aci_rtctrlprofile_deprecated.go +++ /dev/null @@ -1,53 +0,0 @@ -package aci - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" -) - -func resourceAciBgpRouteControlProfile() *schema.Resource { - return &schema.Resource{ - DeprecationMessage: "Use aci_route_control_profile resource instead", - - CreateContext: resourceAciRouteControlProfileCreate, - UpdateContext: resourceAciRouteControlProfileUpdate, - ReadContext: resourceAciRouteControlProfileRead, - DeleteContext: resourceAciRouteControlProfileDelete, - - Importer: &schema.ResourceImporter{ - State: resourceAciRouteControlProfileImport, - }, - - SchemaVersion: 1, - - Schema: AppendBaseAttrSchema(map[string]*schema.Schema{ - "parent_dn": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "name_alias": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "route_control_profile_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "global", - "combinable", - }, false), - }, - }), - } -} diff --git a/aci/resource_aci_rtctrlprofile_deprecated_test.go b/aci/resource_aci_rtctrlprofile_deprecated_test.go deleted file mode 100644 index 2c7dd0ad0..000000000 --- a/aci/resource_aci_rtctrlprofile_deprecated_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package aci - -import ( - "fmt" - "testing" - - "github.com/ciscoecosystem/aci-go-client/v2/client" - "github.com/ciscoecosystem/aci-go-client/v2/models" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -) - -func TestAccAciBgpRouteControlProfile_Basic(t *testing.T) { - var route_control_profile models.RouteControlProfile - description := "route_control_profile created while acceptance testing" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAciBgpRouteControlProfileDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckAciBgpRouteControlProfileConfig_basic(description), - Check: resource.ComposeTestCheckFunc( - testAccCheckAciBgpRouteControlProfileExists("aci_bgp_route_control_profile.test", &route_control_profile), - testAccCheckAciBgpRouteControlProfileAttributes(description, &route_control_profile), - ), - }, - }, - }) -} - -func TestAccAciBgpRouteControlProfile_update(t *testing.T) { - var route_control_profile models.RouteControlProfile - description := "route_control_profile created while acceptance testing" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAciBgpRouteControlProfileDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckAciBgpRouteControlProfileConfig_basic(description), - Check: resource.ComposeTestCheckFunc( - testAccCheckAciBgpRouteControlProfileExists("aci_bgp_route_control_profile.test", &route_control_profile), - testAccCheckAciBgpRouteControlProfileAttributes(description, &route_control_profile), - ), - }, - { - Config: testAccCheckAciBgpRouteControlProfileConfig_basic(description), - Check: resource.ComposeTestCheckFunc( - testAccCheckAciBgpRouteControlProfileExists("aci_bgp_route_control_profile.test", &route_control_profile), - testAccCheckAciBgpRouteControlProfileAttributes(description, &route_control_profile), - ), - }, - }, - }) -} - -func testAccCheckAciBgpRouteControlProfileConfig_basic(description string) string { - return fmt.Sprintf(` - - resource "aci_tenant" "foo_tenant" { - name = "tenant_1" - description = "This tenant is created by terraform ACI provider" - } - - resource "aci_l3_outside" "fool3_outside" { - tenant_dn = aci_tenant.foo_tenant.id - name = "l3_outside_1" - annotation = "l3_outside_tag" - name_alias = "alias_out" - target_dscp = "unspecified" - } - - resource "aci_bgp_route_control_profile" "test" { - parent_dn = aci_l3_outside.fool3_outside.id - name = "one" - annotation = "example" - description = "%s" - name_alias = "example" - route_control_profile_type = "global" - } - `, description) -} - -func testAccCheckAciBgpRouteControlProfileExists(name string, route_control_profile *models.RouteControlProfile) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] - - if !ok { - return fmt.Errorf("Route Control Profile %s not found", name) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No Route Control Profile dn was set") - } - - client := testAccProvider.Meta().(*client.Client) - - cont, err := client.Get(rs.Primary.ID) - if err != nil { - return err - } - - route_control_profileFound := models.RouteControlProfileFromContainer(cont) - if route_control_profileFound.DistinguishedName != rs.Primary.ID { - return fmt.Errorf("Route Control Profile %s not found", rs.Primary.ID) - } - *route_control_profile = *route_control_profileFound - return nil - } -} - -func testAccCheckAciBgpRouteControlProfileDestroy(s *terraform.State) error { - client := testAccProvider.Meta().(*client.Client) - - for _, rs := range s.RootModule().Resources { - - if rs.Type == "aci_bgp_route_control_profile" { - cont, err := client.Get(rs.Primary.ID) - route_control_profile := models.RouteControlProfileFromContainer(cont) - if err == nil { - return fmt.Errorf("Route Control Profile %s Still exists", route_control_profile.DistinguishedName) - } - - } else { - continue - } - } - - return nil -} - -func testAccCheckAciBgpRouteControlProfileAttributes(description string, route_control_profile *models.RouteControlProfile) resource.TestCheckFunc { - return func(s *terraform.State) error { - - if description != route_control_profile.Description { - return fmt.Errorf("Bad route_control_profile Description %s", route_control_profile.Description) - } - - if "one" != route_control_profile.Name { - return fmt.Errorf("Bad route_control_profile name %s", route_control_profile.Name) - } - - if "example" != route_control_profile.Annotation { - return fmt.Errorf("Bad route_control_profile annotation %s", route_control_profile.Annotation) - } - - if "example" != route_control_profile.NameAlias { - return fmt.Errorf("Bad route_control_profile name_alias %s", route_control_profile.NameAlias) - } - - if "global" != route_control_profile.RouteControlProfileType { - return fmt.Errorf("Bad route_control_profile route_control_profile_type %s", route_control_profile.RouteControlProfileType) - } - - return nil - } -} diff --git a/aci/resource_aci_rtctrlprofile_test.go b/aci/resource_aci_rtctrlprofile_test.go deleted file mode 100644 index 6d83c71e4..000000000 --- a/aci/resource_aci_rtctrlprofile_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package aci - -import ( - "fmt" - "testing" - - "github.com/ciscoecosystem/aci-go-client/v2/client" - "github.com/ciscoecosystem/aci-go-client/v2/models" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -) - -func TestAccAciRouteControlProfile_Basic(t *testing.T) { - var route_control_profile models.RouteControlProfile - description := "route_control_profile created while acceptance testing" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAciRouteControlProfileDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckAciRouteControlProfileConfig_basic(description), - Check: resource.ComposeTestCheckFunc( - testAccCheckAciRouteControlProfileExists("aci_route_control_profile.test", &route_control_profile), - testAccCheckAciRouteControlProfileAttributes(description, &route_control_profile), - ), - }, - }, - }) -} - -func TestAccAciRouteControlProfile_update(t *testing.T) { - var route_control_profile models.RouteControlProfile - description := "route_control_profile created while acceptance testing" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAciRouteControlProfileDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckAciRouteControlProfileConfig_basic(description), - Check: resource.ComposeTestCheckFunc( - testAccCheckAciRouteControlProfileExists("aci_route_control_profile.test", &route_control_profile), - testAccCheckAciRouteControlProfileAttributes(description, &route_control_profile), - ), - }, - { - Config: testAccCheckAciRouteControlProfileConfig_basic(description), - Check: resource.ComposeTestCheckFunc( - testAccCheckAciRouteControlProfileExists("aci_route_control_profile.test", &route_control_profile), - testAccCheckAciRouteControlProfileAttributes(description, &route_control_profile), - ), - }, - }, - }) -} - -func testAccCheckAciRouteControlProfileConfig_basic(description string) string { - return fmt.Sprintf(` - - resource "aci_tenant" "foo_tenant" { - name = "tenant_1" - description = "This tenant is created by terraform ACI provider" - } - - resource "aci_l3_outside" "fool3_outside" { - tenant_dn = aci_tenant.foo_tenant.id - name = "l3_outside_1" - annotation = "l3_outside_tag" - name_alias = "alias_out" - target_dscp = "unspecified" - } - - resource "aci_route_control_profile" "test" { - parent_dn = aci_l3_outside.fool3_outside.id - name = "one" - annotation = "example" - description = "%s" - name_alias = "example" - route_control_profile_type = "global" - } - `, description) -} - -func testAccCheckAciRouteControlProfileExists(name string, route_control_profile *models.RouteControlProfile) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] - - if !ok { - return fmt.Errorf("Route Control Profile %s not found", name) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No Route Control Profile dn was set") - } - - client := testAccProvider.Meta().(*client.Client) - - cont, err := client.Get(rs.Primary.ID) - if err != nil { - return err - } - - route_control_profileFound := models.RouteControlProfileFromContainer(cont) - if route_control_profileFound.DistinguishedName != rs.Primary.ID { - return fmt.Errorf("Route Control Profile %s not found", rs.Primary.ID) - } - *route_control_profile = *route_control_profileFound - return nil - } -} - -func testAccCheckAciRouteControlProfileDestroy(s *terraform.State) error { - client := testAccProvider.Meta().(*client.Client) - - for _, rs := range s.RootModule().Resources { - - if rs.Type == "aci_route_control_profile" { - cont, err := client.Get(rs.Primary.ID) - route_control_profile := models.RouteControlProfileFromContainer(cont) - if err == nil { - return fmt.Errorf("Route Control Profile %s Still exists", route_control_profile.DistinguishedName) - } - - } else { - continue - } - } - - return nil -} - -func testAccCheckAciRouteControlProfileAttributes(description string, route_control_profile *models.RouteControlProfile) resource.TestCheckFunc { - return func(s *terraform.State) error { - - if description != route_control_profile.Description { - return fmt.Errorf("Bad route_control_profile Description %s", route_control_profile.Description) - } - - if "one" != route_control_profile.Name { - return fmt.Errorf("Bad route_control_profile name %s", route_control_profile.Name) - } - - if "example" != route_control_profile.Annotation { - return fmt.Errorf("Bad route_control_profile annotation %s", route_control_profile.Annotation) - } - - if "example" != route_control_profile.NameAlias { - return fmt.Errorf("Bad route_control_profile name_alias %s", route_control_profile.NameAlias) - } - - if "global" != route_control_profile.RouteControlProfileType { - return fmt.Errorf("Bad route_control_profile route_control_profile_type %s", route_control_profile.RouteControlProfileType) - } - - return nil - } -} diff --git a/docs/data-sources/bgp_route_control_profile.md b/docs/data-sources/bgp_route_control_profile.md deleted file mode 100644 index 4c3414bf0..000000000 --- a/docs/data-sources/bgp_route_control_profile.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_bgp_route_control_profile" -sidebar_current: "docs-aci-data-source-aci_bgp_route_control_profile" -description: |- - Data source for ACI BGP Route Control Profile ---- - -# aci_bgp_route_control_profile -!> **WARNING:** This data source is deprecated and will be removed in the next major version use aci_route_control_profile instead. -Data source for ACI BGP Route Control Profile - -## Example Usage - -```hcl -data "aci_bgp_route_control_profile" "check" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" -} - -data "aci_bgp_route_control_profile" "check" { - parent_dn = aci_l3_outside.example.id - name = "bgp_route_control_profile_1" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. - -## Attribute Reference - -- `id` - Attribute id set to the Dn of the router control profile object. -- `annotation` - Annotation for router control profile object. -- `description` - Description for router control profile object. -- `name_alias` - Name alias for router control profile object. -- `route_control_profile_type` - Component type for router control profile object. diff --git a/docs/data-sources/route_control_profile.md b/docs/data-sources/route_control_profile.md deleted file mode 100644 index c44d535e1..000000000 --- a/docs/data-sources/route_control_profile.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_route_control_profile" -sidebar_current: "docs-aci-data-source-aci_route_control_profile" -description: |- - Data source for ACI Route Control Profile ---- - -# aci_route_control_profile - -Data source for ACI Route Control Profile - -## Example Usage - -```hcl -data "aci_route_control_profile" "check" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" -} - -data "aci_route_control_profile" "check" { - parent_dn = aci_l3_outside.example.id - name = "route_control_profile_1" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. - -## Attribute Reference - -- `id` - Attribute id set to the Dn of the router control profile object. -- `annotation` - Annotation for router control profile object. -- `description` - Description for router control profile object. -- `name_alias` - Name alias for router control profile object. -- `route_control_profile_type` - Component type for router control profile object. diff --git a/docs/resources/bgp_route_control_profile.md b/docs/resources/bgp_route_control_profile.md deleted file mode 100644 index 4befb534f..000000000 --- a/docs/resources/bgp_route_control_profile.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_bgp_route_control_profile" -sidebar_current: "docs-aci-resource-aci_bgp_route_control_profile" -description: |- - Manages ACI BGP Route Control Profile ---- - -# aci_bgp_route_control_profile -!> **WARNING:** This resource is deprecated and will be removed in the next major version use aci_route_control_profile instead -Manages ACI BGP Route Control Profile - -## Example Usage - -```hcl -resource "aci_bgp_route_control_profile" "example" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" - annotation = "bgp_route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} - -resource "aci_bgp_route_control_profile" "example" { - parent_dn = aci_l3_outside.example.id - name = "bgp_route_control_profile_1" - annotation = "bgp_route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. -- `annotation` - (Optional) Annotation for router control profile object. -- `description` - (Optional) Description for router control profile object. -- `name_alias` - (Optional) Name alias for router control profile object. -- `route_control_profile_type` - (Optional) Component type for router control profile object. Allowed values are "combinable" and "global". Default value is "combinable". - -## Attribute Reference - -The only attribute that this resource exports is the `id`, which is set to the Dn of the Route Control Profile. - -## Importing - -An existing Route Control Profile can be [imported][docs-import] into this resource via its Dn, via the following command: -[docs-import]: https://www.terraform.io/docs/import/index.html - -``` -terraform import aci_bgp_route_control_profile.example -``` diff --git a/docs/resources/route_control_profile.md b/docs/resources/route_control_profile.md deleted file mode 100644 index af9fa8288..000000000 --- a/docs/resources/route_control_profile.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_route_control_profile" -sidebar_current: "docs-aci-resource-aci_route_control_profile" -description: |- - Manages ACI Route Control Profile ---- - -# aci_route_control_profile - -Manages ACI Route Control Profile - -## Example Usage - -```hcl -resource "aci_route_control_profile" "example" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" - annotation = "route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} - -resource "aci_route_control_profile" "example" { - parent_dn = aci_l3_outside.example.id - name = "route_control_profile_1" - annotation = "route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. -- `annotation` - (Optional) Annotation for router control profile object. -- `description` - (Optional) Description for router control profile object. -- `name_alias` - (Optional) Name alias for router control profile object. -- `route_control_profile_type` - (Optional) Component type for router control profile object. Allowed values are "combinable" and "global". Default value is "combinable". - -## Attribute Reference - -The only attribute that this resource exports is the `id`, which is set to the Dn of the Route Control Profile. - -## Importing - -An existing Route Control Profile can be [imported][docs-import] into this resource via its Dn, via the following command: -[docs-import]: https://www.terraform.io/docs/import/index.html - -``` -terraform import aci_route_control_profile.example -``` diff --git a/examples/route_control_profile/main.tf b/examples/route_control_profile/main.tf deleted file mode 100644 index 7edd5aeb7..000000000 --- a/examples/route_control_profile/main.tf +++ /dev/null @@ -1,53 +0,0 @@ -terraform { - required_providers { - aci = { - source = "ciscodevnet/aci" - } - } -} - -#configure provider with your cisco aci credentials. -provider "aci" { - username = "" # - password = "" # - url = "" # - insecure = true -} - -resource "aci_tenant" "tenant_for_route_control" { - name = "tenant_for_route_control" - description = "This tenant is created by terraform ACI provider" -} - -resource "aci_l3_outside" "example" { - tenant_dn = aci_tenant.tenant_for_route_control.id - name = "example_l3out" -} - -resource "aci_route_control_profile" "example" { - parent_dn = aci_tenant.tenant_for_route_control.id - name = "one" - annotation = "example" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} - -resource "aci_route_control_profile" "example2" { - parent_dn = aci_l3_outside.example.id - name = "route_control_profile_1" - annotation = "route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} - -## DEPRECATED VERSION -resource "aci_bgp_route_control_profile" "example" { - parent_dn = aci_tenant.tenant_for_route_control.id - name = "bgp_route_control_profile_1" - annotation = "bgp_route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} diff --git a/legacy-docs/docs/d/bgp_route_control_profile.html.markdown b/legacy-docs/docs/d/bgp_route_control_profile.html.markdown deleted file mode 100644 index 4c3414bf0..000000000 --- a/legacy-docs/docs/d/bgp_route_control_profile.html.markdown +++ /dev/null @@ -1,39 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_bgp_route_control_profile" -sidebar_current: "docs-aci-data-source-aci_bgp_route_control_profile" -description: |- - Data source for ACI BGP Route Control Profile ---- - -# aci_bgp_route_control_profile -!> **WARNING:** This data source is deprecated and will be removed in the next major version use aci_route_control_profile instead. -Data source for ACI BGP Route Control Profile - -## Example Usage - -```hcl -data "aci_bgp_route_control_profile" "check" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" -} - -data "aci_bgp_route_control_profile" "check" { - parent_dn = aci_l3_outside.example.id - name = "bgp_route_control_profile_1" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. - -## Attribute Reference - -- `id` - Attribute id set to the Dn of the router control profile object. -- `annotation` - Annotation for router control profile object. -- `description` - Description for router control profile object. -- `name_alias` - Name alias for router control profile object. -- `route_control_profile_type` - Component type for router control profile object. diff --git a/legacy-docs/docs/d/route_control_profile.html.markdown b/legacy-docs/docs/d/route_control_profile.html.markdown deleted file mode 100644 index c44d535e1..000000000 --- a/legacy-docs/docs/d/route_control_profile.html.markdown +++ /dev/null @@ -1,39 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_route_control_profile" -sidebar_current: "docs-aci-data-source-aci_route_control_profile" -description: |- - Data source for ACI Route Control Profile ---- - -# aci_route_control_profile - -Data source for ACI Route Control Profile - -## Example Usage - -```hcl -data "aci_route_control_profile" "check" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" -} - -data "aci_route_control_profile" "check" { - parent_dn = aci_l3_outside.example.id - name = "route_control_profile_1" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. - -## Attribute Reference - -- `id` - Attribute id set to the Dn of the router control profile object. -- `annotation` - Annotation for router control profile object. -- `description` - Description for router control profile object. -- `name_alias` - Name alias for router control profile object. -- `route_control_profile_type` - Component type for router control profile object. diff --git a/legacy-docs/docs/r/bgp_route_control_profile.html.markdown b/legacy-docs/docs/r/bgp_route_control_profile.html.markdown deleted file mode 100644 index 4befb534f..000000000 --- a/legacy-docs/docs/r/bgp_route_control_profile.html.markdown +++ /dev/null @@ -1,56 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_bgp_route_control_profile" -sidebar_current: "docs-aci-resource-aci_bgp_route_control_profile" -description: |- - Manages ACI BGP Route Control Profile ---- - -# aci_bgp_route_control_profile -!> **WARNING:** This resource is deprecated and will be removed in the next major version use aci_route_control_profile instead -Manages ACI BGP Route Control Profile - -## Example Usage - -```hcl -resource "aci_bgp_route_control_profile" "example" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" - annotation = "bgp_route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} - -resource "aci_bgp_route_control_profile" "example" { - parent_dn = aci_l3_outside.example.id - name = "bgp_route_control_profile_1" - annotation = "bgp_route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. -- `annotation` - (Optional) Annotation for router control profile object. -- `description` - (Optional) Description for router control profile object. -- `name_alias` - (Optional) Name alias for router control profile object. -- `route_control_profile_type` - (Optional) Component type for router control profile object. Allowed values are "combinable" and "global". Default value is "combinable". - -## Attribute Reference - -The only attribute that this resource exports is the `id`, which is set to the Dn of the Route Control Profile. - -## Importing - -An existing Route Control Profile can be [imported][docs-import] into this resource via its Dn, via the following command: -[docs-import]: https://www.terraform.io/docs/import/index.html - -``` -terraform import aci_bgp_route_control_profile.example -``` diff --git a/legacy-docs/docs/r/route_control_profile.html.markdown b/legacy-docs/docs/r/route_control_profile.html.markdown deleted file mode 100644 index af9fa8288..000000000 --- a/legacy-docs/docs/r/route_control_profile.html.markdown +++ /dev/null @@ -1,56 +0,0 @@ ---- -subcategory: "L3Out" -layout: "aci" -page_title: "ACI: aci_route_control_profile" -sidebar_current: "docs-aci-resource-aci_route_control_profile" -description: |- - Manages ACI Route Control Profile ---- - -# aci_route_control_profile - -Manages ACI Route Control Profile - -## Example Usage - -```hcl -resource "aci_route_control_profile" "example" { - parent_dn = aci_tenant.tenentcheck.id - name = "one" - annotation = "route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} - -resource "aci_route_control_profile" "example" { - parent_dn = aci_l3_outside.example.id - name = "route_control_profile_1" - annotation = "route_control_profile_tag" - description = "from terraform" - name_alias = "example" - route_control_profile_type = "global" -} -``` - -## Argument Reference - -- `parent_dn` - (Required) Distinguished name of the parent object. -- `name` - (Required) Name of router control profile object. -- `annotation` - (Optional) Annotation for router control profile object. -- `description` - (Optional) Description for router control profile object. -- `name_alias` - (Optional) Name alias for router control profile object. -- `route_control_profile_type` - (Optional) Component type for router control profile object. Allowed values are "combinable" and "global". Default value is "combinable". - -## Attribute Reference - -The only attribute that this resource exports is the `id`, which is set to the Dn of the Route Control Profile. - -## Importing - -An existing Route Control Profile can be [imported][docs-import] into this resource via its Dn, via the following command: -[docs-import]: https://www.terraform.io/docs/import/index.html - -``` -terraform import aci_route_control_profile.example -```