From 959e842b5832406c380a7497940e982612af62a2 Mon Sep 17 00:00:00 2001 From: Ti Chiapuzio-Wong <16353697+tchiapuziowong@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:30:06 -0800 Subject: [PATCH] prerelease - initial commit --- LICENSE | 373 +++++++++++++++++++++++++++++++ README.md | 69 ++++++ aoscx/provider.go | 88 ++++++++ aoscx/resource_interface.go | 199 +++++++++++++++++ aoscx/resource_l2_interface.go | 303 +++++++++++++++++++++++++ aoscx/resource_vlan.go | 194 ++++++++++++++++ docs/index.md | 22 ++ docs/resources/interface.md | 31 +++ docs/resources/l2_interface.md | 36 +++ docs/resources/vlan.md | 32 +++ go.mod | 50 +++++ go.sum | 202 +++++++++++++++++ main.go | 15 ++ terraform-registry-manifest.json | 6 + 14 files changed, 1620 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 aoscx/provider.go create mode 100644 aoscx/resource_interface.go create mode 100644 aoscx/resource_l2_interface.go create mode 100644 aoscx/resource_vlan.go create mode 100644 docs/index.md create mode 100644 docs/resources/interface.md create mode 100644 docs/resources/l2_interface.md create mode 100644 docs/resources/vlan.md create mode 100644 go.mod create mode 100644 go.sum create mode 100644 main.go create mode 100644 terraform-registry-manifest.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3dec89b --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Terraform Provider for AOS-CX + +The Terraform Provider for AOS-CX provides a set of configuration management modules and resources specifically designed to manage/configure AOS-CX switches using REST API. + + +## Requirements + +- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.x +- [Go](https://golang.org/doc/install) >= 1.18 +- Install AOS-CX Terraform Provider from Terraform Registry + - Terraform 0.13 added support for automatically downloading providers from the terraform registry. Add the following to your terraform project + + ``` + terraform { + required_providers { + aoscx = { + version = "=> 1.0.0" + source = "aruba/aoscx" + } + } + } + ``` + + +## Using the AOS-CX provider + +To use the AOS-CX Terraform provider you'll need to define the switch connection details inside a provider block with the following variables: +- `hostname`: IP address of the switch +- `username`: Username used to login to the switch using REST API +- `password`: Password used to login to the switch using REST API + - see Terraform's documentation on how to [Protect Sensitive Input Variables](https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables) +``` +provider "aoscx" { + hostname = "10.6.7.16" + username = "admin" + password = "admin" +} +``` + +Once the provider is defined then you'll define the resources you want Terraform manage on your CX switch. To see all supported resources and their required/optional values see the [/docs](https://github.com/aruba/terraform-provider-aoscx/tree/master/docs) directory. + +Here's an example: +``` +resource "aoscx_vlan" "vlan42" { + vlan_id = 42 + name = "terraform vlan" +} + +resource "aoscx_interface" "int_1_1_14" { + name = "1/1/14" + admin_state = "down" + description = "terraform_uplink" +} + +resource "aoscx_l2_interface" "int_1_1_15" { + interface = "1/1/15" + admin_state = "up" + description = "terraform_downlink" + vlan_mode = "access" + vlan_tag = 42 +} +resource "aoscx_l2_interface" "int_1_1_16" { + interface = "1/1/16" + admin_state = "down" + vlan_mode = "trunk" + vlan_ids = [20, 42] + native_vlan_tag = true +} +``` diff --git a/aoscx/provider.go b/aoscx/provider.go new file mode 100644 index 0000000..b176113 --- /dev/null +++ b/aoscx/provider.go @@ -0,0 +1,88 @@ +package aoscx + +import ( + "context" + "crypto/tls" + "net/http" + + "github.com/aruba/aoscxgo" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +type Aoscx struct { + hostname string + username string + password string + rest_version string + cookie *http.Cookie +} + +func Provider() *schema.Provider { + return &schema.Provider{ + Schema: map[string]*schema.Schema{ + "hostname": { + Type: schema.TypeString, + Required: true, + Optional: false, + Description: "Hostname/IP address of the AOS-CX switch to connect to", + }, + "username": { + Type: schema.TypeString, + Optional: false, + Required: true, + Description: "Username used to authenticate", + }, + "password": { + Type: schema.TypeString, + Optional: false, + Required: true, + Description: "Password used to authenticate", + }, + }, + ResourcesMap: map[string]*schema.Resource{ + "aoscx_vlan": resourceVlan(), + "aoscx_interface": resourceInterface(), + "aoscx_l2_interface": resourceL2Interface(), + }, + ConfigureContextFunc: providerConfigure, + } +} + +func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { + hostname := d.Get("hostname").(string) + username := d.Get("username").(string) + password := d.Get("password").(string) + + var diags diag.Diagnostics + + if (hostname != "") && (username != "") && (password != "") { + tr := &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + } + + sw, err := aoscxgo.Connect( + &aoscxgo.Client{ + Hostname: hostname, + Username: username, + Password: password, + Transport: tr, + }, + ) + + if (sw.Cookie == nil) || (err != nil) { + return nil, diag.FromErr(err) + } + + return sw, diags + } + + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Unable to create AOS-CX client", + Detail: "Invalid or no values found for hostname, username, password", + }) + + return nil, diags +} diff --git a/aoscx/resource_interface.go b/aoscx/resource_interface.go new file mode 100644 index 0000000..80d9a34 --- /dev/null +++ b/aoscx/resource_interface.go @@ -0,0 +1,199 @@ +package aoscx + +import ( + "context" + + "github.com/aruba/aoscxgo" + + "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 resourceInterface() *schema.Resource { + return &schema.Resource{ + Description: "Resource to configure interfaces physical attributes on AOS-CX switches.", + CreateContext: resourceInterfaceCreate, + ReadContext: resourceInterfaceRead, + UpdateContext: resourceInterfaceUpdate, + DeleteContext: resourceInterfaceDelete, + + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Optional: true, + }, + "admin_state": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Default: "up", + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"up", "down"}, true), + }, + }, + } +} + +func resourceInterfaceCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + tmp_int := aoscxgo.Interface{ + Name: d.Get("name").(string), + Description: d.Get("description").(string), + AdminState: d.Get("admin_state").(string), + } + + err = tmp_int.Create(sw) + + //defer logout(tr, cookie, url) + + if materialized := tmp_int.GetStatus(); !materialized { + + err = tmp_int.Get(sw) + + if err != nil { + { + diags = append(diags, diag.Errorf("Error in Creating Interface ", err)...) + return diags + } + } + + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "Interface Already Existing", + Detail: string(tmp_int.Name), + }) + + err = tmp_int.Update(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating Interface does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating Interface: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + } + + d.SetId(d.Get("name").(string)) + d.Set("name", d.Get("name").(string)) + + resourceInterfaceRead(ctx, d, m) + + return diags +} + +func resourceInterfaceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve Interface from sw if existing + tmp_int := aoscxgo.Interface{ + Name: d.Get("name").(string), + } + //tmp_vlan.GetStatus() will return if existing + err = tmp_int.Get(sw) + + if err != nil { + //Failure in VLAN retrieval + d.SetId("") + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "Interface Not Found", + Detail: "Interface Not Found", + }) + return diags + } + + d.Set("name", tmp_int.Name) + d.Set("description", tmp_int.Description) + d.Set("admin_state", tmp_int.AdminState) + + return diags +} + +func resourceInterfaceUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve Interface from sw if existing + tmp_int := aoscxgo.Interface{ + Name: d.Get("name").(string), + } + //tmp_vlan.GetStatus() will return if existing + err = tmp_int.Get(sw) + + if d.HasChange("description") { + tmp_int.Description = d.Get("description").(string) + } + + if d.HasChange("admin_state") { + tmp_state := d.Get("admin_state").(string) + if tmp_state == "" || (tmp_state != "down" && tmp_state != "up") { + tmp_int.AdminState = "down" + d.Set("admin_state", "down") + // Should enforce value can only be up or down + } + tmp_int.AdminState = tmp_state + } + + err = tmp_int.Update(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating Interface does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating Interface: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + return resourceInterfaceRead(ctx, d, m) +} + +func resourceInterfaceDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Create Interface Obj + tmp_int := aoscxgo.Interface{ + Name: d.Get("name").(string), + } + + err = tmp_int.Delete(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating Interface does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating Interface: %s ", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + d.SetId("") + return nil +} diff --git a/aoscx/resource_l2_interface.go b/aoscx/resource_l2_interface.go new file mode 100644 index 0000000..068e862 --- /dev/null +++ b/aoscx/resource_l2_interface.go @@ -0,0 +1,303 @@ +package aoscx + +import ( + "context" + + "github.com/aruba/aoscxgo" + + "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 resourceL2Interface() *schema.Resource { + return &schema.Resource{ + Description: "Resource to configure interface Layer2 attributes on AOS-CX switches.", + CreateContext: resourceL2InterfaceCreate, + ReadContext: resourceL2InterfaceRead, + UpdateContext: resourceL2InterfaceUpdate, + DeleteContext: resourceL2InterfaceDelete, + + Schema: map[string]*schema.Schema{ + "interface": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Optional: true, + }, + "admin_state": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Default: "up", + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"up", "down"}, true), + }, + "vlan_mode": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Default: "access", + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"access", "trunk"}, true), + }, + "vlan_tag": &schema.Schema{ + Type: schema.TypeInt, + Required: false, + Default: 1, + Optional: true, + }, + "vlan_ids": &schema.Schema{ + Type: schema.TypeSet, + Required: false, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + Optional: true, + }, + "trunk_allowed_all": &schema.Schema{ + Type: schema.TypeBool, + Required: false, + Default: false, + Optional: true, + }, + "native_vlan_tag": &schema.Schema{ + Type: schema.TypeBool, + Required: false, + Default: false, + Optional: true, + }, + }, + } +} + +func resourceL2InterfaceCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + tmp_int := aoscxgo.Interface{ + Name: d.Get("interface").(string), + AdminState: d.Get("admin_state").(string), + } + + err = tmp_int.Create(sw) + + if materialized := tmp_int.GetStatus(); !materialized { + + err = tmp_int.Get(sw) + + if err != nil { + { + diags = append(diags, diag.Errorf("Error in Creating Interface ", err)...) + return diags + } + } + + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "Interface Already Existing", + Detail: string(tmp_int.Name), + }) + + vlan_mode := d.Get("vlan_mode").(string) + + tmp_l2_int := aoscxgo.L2Interface{} + if vlan_mode == "access" { + tmp_l2_int.Interface = tmp_int + tmp_l2_int.Description = d.Get("description").(string) + tmp_l2_int.VlanMode = d.Get("vlan_mode").(string) + tmp_l2_int.VlanTag = d.Get("vlan_tag").(int) + + } else if vlan_mode == "trunk" { + tmp_l2_int.Interface = tmp_int + tmp_l2_int.Description = d.Get("description").(string) + tmp_l2_int.VlanMode = d.Get("vlan_mode").(string) + tmp_l2_int.NativeVlanTag = d.Get("native_vlan_tag").(bool) + tmp_l2_int.VlanTag = d.Get("vlan_tag").(int) + tmp_l2_int.TrunkAllowedAll = d.Get("trunk_allowed_all").(bool) + tmp_set := d.Get("vlan_ids").(*schema.Set) + tmp_l2_int.VlanIds = tmp_set.List() + } + + err = tmp_l2_int.Create(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating Interface does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating Interface: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + } + + d.SetId(d.Get("interface").(string)) + d.Set("interface", d.Get("interface").(string)) + + resourceL2InterfaceRead(ctx, d, m) + + return diags +} + +func resourceL2InterfaceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve Interface from sw if existing + tmp_int := aoscxgo.L2Interface{ + Interface: aoscxgo.Interface{ + Name: d.Get("interface").(string), + }} + + err = tmp_int.Get(sw) + + if err != nil { + //Failure in Interface retrieval + d.SetId("") + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "Interface Not Found", + Detail: "Interface Not Found", + }) + return diags + } + + if tmp_int.VlanMode == "access" || tmp_int.VlanMode == "" { + d.Set("vlan_mode", "access") + d.Set("vlan_tag", tmp_int.VlanTag) + + } else if tmp_int.VlanMode == "trunk" || tmp_int.VlanMode == "native-tagged" || tmp_int.VlanMode == "native-untagged" { + d.Set("vlan_mode", "trunk") + d.Set("native_vlan_tag", tmp_int.NativeVlanTag) + d.Set("trunk_allowed_all", tmp_int.TrunkAllowedAll) + d.Set("vlan_ids", tmp_int.VlanIds) + if tmp_int.VlanTag == 0 { + d.Set("vlan_tag", 1) + } else { + d.Set("vlan_tag", tmp_int.VlanTag) + } + + } + + d.Set("interface", tmp_int.Interface.Name) + d.Set("description", tmp_int.Description) + + d.Set("admin_state", tmp_int.Interface.AdminState) + + return diags +} + +func resourceL2InterfaceUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve Interface from sw if existing + tmp_l2_int := aoscxgo.L2Interface{ + Interface: aoscxgo.Interface{ + Name: d.Get("interface").(string), + }} + + err = tmp_l2_int.Get(sw) + + // Flag to determine if put should be used instead of patch + use_put := false + + if d.HasChange("description") { + tmp_l2_int.Description = d.Get("description").(string) + } + if d.HasChange("vlan_mode") { + tmp_vlan_mode := d.Get("vlan_mode").(string) + use_put = true + + if tmp_vlan_mode == "access" { + tmp_l2_int.VlanMode = tmp_vlan_mode + tmp_l2_int.VlanTag = d.Get("vlan_tag").(int) + + } else if tmp_vlan_mode == "trunk" { + // need to figure out how to retrieve value from terraform config file + // include logic that will only + // I need to change VlanMode attribute to include logic to handle translation be trunk = ["native-untagged", "native-tagged"] + tmp_l2_int.VlanMode = tmp_vlan_mode + tmp_l2_int.VlanTag = d.Get("vlan_tag").(int) + tmp_l2_int.NativeVlanTag = d.Get("native_vlan_tag").(bool) + tmp_l2_int.TrunkAllowedAll = d.Get("trunk_allowed_all").(bool) + tmp_set := d.Get("vlan_ids").(*schema.Set) + tmp_l2_int.VlanIds = tmp_set.List() + } + } + if d.HasChange("vlan_tag") { + tmp_l2_int.VlanTag = d.Get("vlan_tag").(int) + } + + if d.HasChange("vlan_ids") { + tmp_l2_int.VlanIds = d.Get("vlan_ids").([]interface{}) + } + + if d.HasChange("trunk_allowed_all") { + tmp_l2_int.TrunkAllowedAll = d.Get("trunk_allowed_all").(bool) + } + + if d.HasChange("native_vlan_tag") { + tmp_l2_int.NativeVlanTag = d.Get("native_vlan_tag").(bool) + } + + if d.HasChange("admin_state") { + tmp_state := d.Get("admin_state").(string) + if tmp_state == "" || (tmp_state != "down" && tmp_state != "up") { + tmp_l2_int.Interface.AdminState = "down" + d.Set("admin_state", "down") + } + tmp_l2_int.Interface.AdminState = tmp_state + } + + err = tmp_l2_int.Update(sw, use_put) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating Interface does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating Interface: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + return resourceL2InterfaceRead(ctx, d, m) +} + +func resourceL2InterfaceDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Create Interface Obj + tmp_int := aoscxgo.Interface{ + Name: d.Get("interface").(string), + } + + err = tmp_int.Delete(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating Interface does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating Interface: %s ", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + d.SetId("") + return nil +} diff --git a/aoscx/resource_vlan.go b/aoscx/resource_vlan.go new file mode 100644 index 0000000..aac3679 --- /dev/null +++ b/aoscx/resource_vlan.go @@ -0,0 +1,194 @@ +package aoscx + +import ( + "context" + "strconv" + + "github.com/aruba/aoscxgo" + + "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 resourceVlan() *schema.Resource { + return &schema.Resource{ + Description: "Resource to configure VLANs on AOS-CX switches.", + CreateContext: resourceVlanCreate, + ReadContext: resourceVlanRead, + UpdateContext: resourceVlanUpdate, + DeleteContext: resourceVlanDelete, + Schema: map[string]*schema.Schema{ + "vlan_id": &schema.Schema{ + Type: schema.TypeInt, + Required: true, + ForceNew: true, + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Optional: true, + }, + "admin_state": &schema.Schema{ + Type: schema.TypeString, + Required: false, + Default: "up", + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"up", "down"}, true), + }, + }, + } +} + +func resourceVlanCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + vlan_id := d.Get("vlan_id").(int) + + tmp_vlan := aoscxgo.Vlan{ + VlanId: vlan_id, + Name: d.Get("name").(string), + Description: d.Get("description").(string), + AdminState: d.Get("admin_state").(string), + } + + err = tmp_vlan.Create(sw) + + //defer logout(tr, cookie, url) + + if materialized := tmp_vlan.GetStatus(); !materialized { + + err = tmp_vlan.Get(sw) + + if err != nil { + { + diags = append(diags, diag.Errorf("Error in Creating VLAN ", err)...) + return diags + } + } + + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "VLAN Already Existing", + Detail: string(tmp_vlan.VlanId), + }) + + } + + d.SetId(strconv.Itoa(vlan_id)) + d.Set("vlan_id", vlan_id) + + resourceVlanRead(ctx, d, m) + + return diags +} + +func resourceVlanRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve VLAN from sw if existing + tmp_vlan := aoscxgo.Vlan{ + VlanId: d.Get("vlan_id").(int), + } + + err = tmp_vlan.Get(sw) + + if err != nil { + // Failure in VLAN retrieval + d.SetId("") + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "VLAN Not Found", + Detail: "VLAN Not Found", + }) + return diags + } + + d.Set("name", tmp_vlan.Name) + d.Set("description", tmp_vlan.Description) + d.Set("admin_state", tmp_vlan.AdminState) + + return diags +} + +func resourceVlanUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve VLAN from sw if existing + tmp_vlan := aoscxgo.Vlan{ + VlanId: d.Get("vlan_id").(int), + } + + err = tmp_vlan.Get(sw) + + if d.HasChange("name") { + tmp_vlan.Name = d.Get("name").(string) + } + + if d.HasChange("description") { + tmp_vlan.Description = d.Get("description").(string) + } + + if d.HasChange("admin_state") { + tmp_state := d.Get("admin_state").(string) + if tmp_state == "" || (tmp_state != "down" && tmp_state != "up") { + tmp_vlan.AdminState = "down" + d.Set("admin_state", "down") + } + tmp_vlan.AdminState = tmp_state + } + + err = tmp_vlan.Update(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating VLAN does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating VLAN: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + return resourceVlanRead(ctx, d, m) +} + +func resourceVlanDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + var err error + + sw := m.(*aoscxgo.Client) + + // Retrieve VLAN from sw if existing + tmp_vlan := aoscxgo.Vlan{ + VlanId: d.Get("vlan_id").(int), + } + + err = tmp_vlan.Delete(sw) + + if err != nil { + if err.(*aoscxgo.RequestError).StatusCode == "404 Not Found" { + diags = append(diags, diag.Errorf("Error Updating VLAN does not exist: %s", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } else if err.(*aoscxgo.RequestError).StatusCode != "204 No Content" { + diags = append(diags, diag.Errorf("Error in Updating VLAN: %s ", err.(*aoscxgo.RequestError).StatusCode)...) + return diags + } + } + + d.SetId("") + return nil +} diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..322b68e --- /dev/null +++ b/docs/index.md @@ -0,0 +1,22 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "aoscx Provider" +subcategory: "" +description: |- + +--- + +# aoscx Provider + + + + + + +## Schema + +### Required + +- `hostname` (String) Hostname/IP address of the AOS-CX switch to connect to +- `password` (String) Password used to authenticate +- `username` (String) Username used to authenticate diff --git a/docs/resources/interface.md b/docs/resources/interface.md new file mode 100644 index 0000000..f95d4bb --- /dev/null +++ b/docs/resources/interface.md @@ -0,0 +1,31 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "aoscx_interface Resource - terraform-provider-aoscx" +subcategory: "" +description: |- + Resource to configure interfaces physical attributes on AOS-CX switches. +--- + +# aoscx_interface (Resource) + +Resource to configure interfaces physical attributes on AOS-CX switches. + + + + +## Schema + +### Required + +- `name` (String) + +### Optional + +- `admin_state` (String) +- `description` (String) + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/docs/resources/l2_interface.md b/docs/resources/l2_interface.md new file mode 100644 index 0000000..5986b45 --- /dev/null +++ b/docs/resources/l2_interface.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "aoscx_l2_interface Resource - terraform-provider-aoscx" +subcategory: "" +description: |- + Resource to configure interface Layer2 attributes on AOS-CX switches. +--- + +# aoscx_l2_interface (Resource) + +Resource to configure interface Layer2 attributes on AOS-CX switches. + + + + +## Schema + +### Required + +- `interface` (String) + +### Optional + +- `admin_state` (String) +- `description` (String) +- `native_vlan_tag` (Boolean) +- `trunk_allowed_all` (Boolean) +- `vlan_ids` (Set of Number) +- `vlan_mode` (String) +- `vlan_tag` (Number) + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/docs/resources/vlan.md b/docs/resources/vlan.md new file mode 100644 index 0000000..d09b72c --- /dev/null +++ b/docs/resources/vlan.md @@ -0,0 +1,32 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "aoscx_vlan Resource - terraform-provider-aoscx" +subcategory: "" +description: |- + Resource to configure VLANs on AOS-CX switches. +--- + +# aoscx_vlan (Resource) + +Resource to configure VLANs on AOS-CX switches. + + + + +## Schema + +### Required + +- `name` (String) +- `vlan_id` (Number) + +### Optional + +- `admin_state` (String) +- `description` (String) + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..305646b --- /dev/null +++ b/go.mod @@ -0,0 +1,50 @@ +module github.com/aruba/terraform-provider-aoscx + +go 1.18 + +require ( + github.com/aruba/aoscxgo v0.0.0-20230117213530-28f54e4dca6e + github.com/aruba/terraform-provider-aoscx v0.0.0-20230118200912-3bcd78b23307 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 +) + +require ( + github.com/agext/levenshtein v1.2.2 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect + github.com/hashicorp/go-hclog v1.2.1 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-plugin v1.4.6 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/hcl/v2 v2.15.0 // indirect + github.com/hashicorp/logutils v1.0.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.14.1 // indirect + github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect + github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect + github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect + github.com/vmihailenco/tagparser v0.1.1 // indirect + github.com/zclconf/go-cty v1.12.1 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect + google.golang.org/grpc v1.50.1 // indirect + google.golang.org/protobuf v1.28.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..7bdff7c --- /dev/null +++ b/go.sum @@ -0,0 +1,202 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= +github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/aruba/aoscxgo v0.0.0-20230117213530-28f54e4dca6e h1:GEmSmdre9Ag89tRhMhftFv5T1kuefiPKfjteQL2i+aw= +github.com/aruba/aoscxgo v0.0.0-20230117213530-28f54e4dca6e/go.mod h1:dWtjwz7of1D1Vx/KCpP+iBN3GwmOGf66brCQWTzBRYA= +github.com/aruba/terraform-provider-aoscx v0.0.0-20230118200912-3bcd78b23307 h1:evYrqC6PSeKiiRvHKHT9yTEvxkkx1INKV3v15wMFMv0= +github.com/aruba/terraform-provider-aoscx v0.0.0-20230118200912-3bcd78b23307/go.mod h1:I9lx1IizxBZ7FDEjCt1hb96d+pSLB3mzd6dDssef+dg= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= +github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.4.6 h1:MDV3UrKQBM3du3G7MApDGvOsMYy3JQJ4exhSoKBAeVA= +github.com/hashicorp/go-plugin v1.4.6/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hcl/v2 v2.15.0 h1:CPDXO6+uORPjKflkWCCwoWc9uRp+zSIPcCQ+BrxV7m8= +github.com/hashicorp/hcl/v2 v2.15.0/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H29tczAwrB0z9Zek= +github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ= +github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= +github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw= +github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg= +github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= +github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go new file mode 100644 index 0000000..cb4738e --- /dev/null +++ b/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" + "github.com/aruba/terraform-provider-aoscx/aoscx" +) + +func main() { + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() *schema.Provider { + return aoscx.Provider() + }, + }) +} diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 0000000..c6212db --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": ["5.0"] + } +} \ No newline at end of file