diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml new file mode 100644 index 00000000..14555dba --- /dev/null +++ b/.github/workflows/acceptance.yml @@ -0,0 +1,135 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: Acceptance Test + +on: + pull_request: + paths: + - .github/workflows/acceptance.yml + - '**.go' + push: + paths: + - .github/workflows/acceptance.yml + - '**.go' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-acceptance + cancel-in-progress: true + +permissions: + contents: read + +env: + CLOUDSTACK_API_URL: http://localhost:8080/client/api + CLOUDSTACK_VERSIONS: "['4.18.2.0', '4.19.0.1']" + +jobs: + prepare-matrix: + runs-on: ubuntu-latest + outputs: + cloudstack-versions: ${{ steps.set-versions.outputs.cloudstack-versions }} + steps: + - name: Set versions + id: set-versions + run: | + echo "cloudstack-versions=${{ env.CLOUDSTACK_VERSIONS }}" >> $GITHUB_OUTPUT + + acceptance-terraform: + name: Terraform ${{ matrix.terraform-version }} with Cloudstack ${{ matrix.cloudstack-version }} + needs: [prepare-matrix] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Configure Cloudstack v${{ matrix.cloudstack-version }} + uses: ./.github/workflows/setup-cloudstack + id: setup-cloudstack + with: + cloudstack-version: ${{ matrix.cloudstack-version }} + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ matrix.terraform-version }} + terraform_wrapper: false + - name: Run acceptance test + env: + CLOUDSTACK_USER_ID: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_USER_ID }} + CLOUDSTACK_API_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_API_KEY }} + CLOUDSTACK_SECRET_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_SECRET_KEY }} + run: | + make testacc + services: + cloudstack-simulator: + image: apache/cloudstack-simulator:${{ matrix.cloudstack-version }} + ports: + - 8080:5050 + strategy: + fail-fast: false + matrix: + terraform-version: + - '1.7.*' + - '1.8.*' + cloudstack-version: ${{ fromJson(needs.prepare-matrix.outputs.cloudstack-versions) }} + + acceptance-opentofu: + name: OpenTofu ${{ matrix.opentofu-version }} with Cloudstack ${{ matrix.cloudstack-version }} + needs: [prepare-matrix] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Configure Cloudstack v${{ matrix.cloudstack-version }} + uses: ./.github/workflows/setup-cloudstack + id: setup-cloudstack + with: + cloudstack-version: ${{ matrix.cloudstack-version }} + - uses: opentofu/setup-opentofu@v1 + with: + tofu_version: ${{ matrix.opentofu-version }} + - name: Run acceptance test + env: + CLOUDSTACK_USER_ID: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_USER_ID }} + CLOUDSTACK_API_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_API_KEY }} + CLOUDSTACK_SECRET_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_SECRET_KEY }} + run: | + make testacc + services: + cloudstack-simulator: + image: apache/cloudstack-simulator:${{ matrix.cloudstack-version }} + ports: + - 8080:5050 + strategy: + fail-fast: false + matrix: + opentofu-version: + - '1.6.*' + cloudstack-version: ${{ fromJson(needs.prepare-matrix.outputs.cloudstack-versions) }} + + all-jobs-passed: # Will succeed if it is skipped + runs-on: ubuntu-latest + needs: [acceptance-terraform, acceptance-opentofu] + # Only run if any of the previous jobs failed + if: ${{ failure() }} + steps: + - name: Previous jobs failed + run: exit 1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d13ff5b..6408ca3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,25 +22,24 @@ on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true - permissions: contents: read jobs: build: runs-on: ubuntu-22.04 - + steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.19.x - - - name: Build - run: | - make build - - - name: Test - run: make test + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version-file: 'go.mod' + + - name: Build + run: | + make build + + - name: Test + run: make test diff --git a/.github/workflows/setup-cloudstack/action.yml b/.github/workflows/setup-cloudstack/action.yml new file mode 100644 index 00000000..dcbdbbe4 --- /dev/null +++ b/.github/workflows/setup-cloudstack/action.yml @@ -0,0 +1,83 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: Setup Cloudstack + +inputs: + cloudstack-version: + description: 'Cloudstack version' + required: true +outputs: + CLOUDSTACK_USER_ID: + description: 'Cloudstack user id' + value: ${{ steps.setup-cloudstack.outputs.user_id }} + CLOUDSTACK_API_KEY: + description: 'Cloudstack api key' + value: ${{ steps.setup-cloudstack.outputs.api_key }} + CLOUDSTACK_SECRET_KEY: + description: 'Cloudstack secret key' + value: ${{ steps.setup-cloudstack.outputs.secret_key }} + CLOUDSTACK_API_URL: + description: 'Cloudstack API URL' + value: http://localhost:8080/client/api + +runs: + using: composite + steps: + - name: Wait Cloudstack to be ready + shell: bash + run: | + echo "Starting Cloudstack health check" + T=0 + until [ $T -gt 20 ] || curl -sfL http://localhost:8080 --output /dev/null + do + echo "Waiting for Cloudstack to be ready..." + ((T+=1)) + sleep 30 + done + - name: Setting up Cloudstack + id: setup-cloudstack + shell: bash + run: | + docker exec $(docker container ls --format=json -l | jq -r .ID) python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg + curl -sf --location "${CLOUDSTACK_API_URL}" \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --data-urlencode 'command=login' \ + --data-urlencode 'username=admin' \ + --data-urlencode 'password=password' \ + --data-urlencode 'response=json' \ + --data-urlencode 'domain=/' -j -c cookies.txt --output /dev/null + + CLOUDSTACK_USER_ID=$(curl -fs "${CLOUDSTACK_API_URL}?command=listUsers&response=json" -b cookies.txt | jq -r '.listusersresponse.user[0].id') + CLOUDSTACK_API_KEY=$(curl -s "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.apikey') + CLOUDSTACK_SECRET_KEY=$(curl -fs "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.secretkey') + + echo "::add-mask::$CLOUDSTACK_API_KEY" + echo "::add-mask::$CLOUDSTACK_SECRET_KEY" + + echo "user_id=$CLOUDSTACK_USER_ID" >> $GITHUB_OUTPUT + echo "api_key=$CLOUDSTACK_API_KEY" >> $GITHUB_OUTPUT + echo "secret_key=$CLOUDSTACK_SECRET_KEY" >> $GITHUB_OUTPUT + - name: Install CMK + shell: bash + run: | + curl -sfL https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.3.0/cmk.linux.x86-64 -o /usr/local/bin/cmk + chmod +x /usr/local/bin/cmk + - name: Create extra resources + shell: bash + run: | + cmk -u $CLOUDSTACK_API_URL -k $CLOUDSTACK_API_KEY -s $CLOUDSTACK_SECRET_KEY -o json create project name=terraform displaytext=terraform diff --git a/.github/workflows/testacc.yml b/.github/workflows/testacc.yml deleted file mode 100644 index 25344855..00000000 --- a/.github/workflows/testacc.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -name: Acceptance Test - -on: [push, pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-testacc - cancel-in-progress: true - -permissions: - contents: read - -jobs: - testacc: - name: Acceptance Test - runs-on: ubuntu-22.04 - env: - CLOUDSTACK_API_URL: http://localhost:8080/client/api - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.19.x - - name: Wait Cloudstack to be ready - run: | - echo "Starting Cloudstack health check" - T=0 - until [ $T -gt 20 ] || curl -sfL http://localhost:8080 --output /dev/null - do - echo "Waiting for Cloudstack to be ready..." - ((T+=1)) - sleep 30 - done - - name: Setting up Cloudstack - run: | - docker exec $(docker container ls --format=json -l | jq -r .ID) python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg - curl -sf --location "${CLOUDSTACK_API_URL}" \ - --header 'Content-Type: application/x-www-form-urlencoded' \ - --data-urlencode 'command=login' \ - --data-urlencode 'username=admin' \ - --data-urlencode 'password=password' \ - --data-urlencode 'response=json' \ - --data-urlencode 'domain=/' -j -c cookies.txt --output /dev/null - - CLOUDSTACK_USER_ID=$(curl -fs "${CLOUDSTACK_API_URL}?command=listUsers&response=json" -b cookies.txt | jq -r '.listusersresponse.user[0].id') - CLOUDSTACK_API_KEY=$(curl -s "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.apikey') - CLOUDSTACK_SECRET_KEY=$(curl -fs "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.secretkey') - - echo "::add-mask::$CLOUDSTACK_API_KEY" - echo "::add-mask::$CLOUDSTACK_SECRET_KEY" - - echo "CLOUDSTACK_API_KEY=$CLOUDSTACK_API_KEY" >> $GITHUB_ENV - echo "CLOUDSTACK_SECRET_KEY=$CLOUDSTACK_SECRET_KEY" >> $GITHUB_ENV - echo "CLOUDSTACK_TEMPLATE_URL=http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-xen.vhd.bz2" >> $GITHUB_ENV - - name: Install CMK - run: | - curl -sfL https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.3.0/cmk.linux.x86-64 -o /usr/local/bin/cmk - chmod +x /usr/local/bin/cmk - - name: Create extra resources - run: | - cmk -u $CLOUDSTACK_API_URL -k $CLOUDSTACK_API_KEY -s $CLOUDSTACK_SECRET_KEY -o json create project name=terraform displaytext=terraform - - name: Run acceptance test - run: | - make testacc - services: - cloudstack-simulator: - image: apache/cloudstack-simulator:${{ matrix.cloudstack_version }} - ports: - - 8080:5050 - strategy: - fail-fast: false - matrix: - cloudstack_version: - - 4.17.2.0 - - 4.18.1.0 - - 4.19.0.0 diff --git a/README.md b/README.md index d7baa427..3d2844d0 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,13 @@ -CloudStack Terraform Provider -============================= +# CloudStack Terraform Provider -Requirements ------------- +## Requirements -- [Terraform](https://www.terraform.io/downloads.html) 1.0.x -- [Go](https://golang.org/doc/install) 1.20+ (to build the provider plugin) +- [Terraform](https://www.terraform.io/downloads.html) 1.0.x +- [Go](https://golang.org/doc/install) 1.20+ (to build the provider plugin) See wiki: https://github.com/apache/cloudstack-terraform-provider/wiki -Installing from Github Release ------------------------------- +## Installing from Github Release User can install the CloudStack Terraform Provider using the [Github Releases](https://github.com/apache/cloudstack-terraform-provider/releases) with the installation steps below. @@ -59,9 +56,10 @@ provider "cloudstack" { Note: this can be used when users are not able to install using the Terraform registry. -Installing from Terrafrom registry ----------------------------------- +## Installing from Terrafrom registry + To install the CloudStack provider, copy and paste the below code into your Terraform configuration. Then, run terraform init. + ```sh terraform { required_providers { @@ -79,15 +77,13 @@ provider "cloudstack" { User hitting installation issue using registry can install using the local install method. -Documentation -------------- +## Documentation For more details on how to use the provider, click [here](website/) or visit https://registry.terraform.io/providers/cloudstack/cloudstack/latest/docs -Developing the Provider ---------------------------- +## Developing the Provider -If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.16+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`. +If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.16+ is _required_). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`. Clone repository to: `$GOPATH/src/github.com/apache/cloudstack-terraform-provider` @@ -105,6 +101,7 @@ $ cd $GOPATH/src/github.com/apache/cloudstack-terraform-provider $ make build $ ls $GOPATH/bin/terraform-provider-cloudstack ``` + Once the build is ready, you have to copy the binary into Terraform locally (version appended). On Linux and Mac this path is at ~/.terraform.d/plugins, @@ -116,8 +113,7 @@ $ mkdir -p ~/.terraform.d/plugins/localdomain/provider/cloudstack/0.4.0/linux_a $ cp $GOPATH/bin/terraform-provider-cloudstack ~/.terraform.d/plugins/localdomain/provider/cloudstack/0.4.0/linux_amd64 ``` -Testing the Provider --------------------- +## Testing the Provider In order to test the provider, you can simply run `make test`. @@ -132,13 +128,13 @@ docker pull apache/cloudstack-simulator or pull it with a particular build tag -docker pull apache/cloudstack-simulator:4.17.2.0 +docker pull apache/cloudstack-simulator:4.19.0.0 docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator or -docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator:4.17.2.0 +docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator:4.19.0.0 ``` When Docker started the container you can go to http://localhost:8080/client and login to the CloudStack UI as user `admin` with password `password`. It can take a few minutes for the container is fully ready, so you probably need to wait and refresh the page for a few minutes before the login page is shown. @@ -163,8 +159,8 @@ In order for all the tests to pass, you will need to create a new (empty) projec $ make testacc ``` -Sample Terraform configuration when testing locally ------------------------------------------------------------- +## Sample Terraform configuration when testing locally + Below is an example configuration to initialize provider and create a Virtual Machine instance ```sh @@ -180,9 +176,9 @@ terraform { provider "cloudstack" { # Configuration options - api_url = "${var.cloudstack_api_url}" - api_key = "${var.cloudstack_api_key}" - secret_key = "${var.cloudstack_secret_key}" + api_url = var.cloudstack_api_url + api_key = var.cloudstack_api_key + secret_key = var.cloudstack_secret_key } resource "cloudstack_instance" "web" { @@ -193,6 +189,7 @@ resource "cloudstack_instance" "web" { zone = "2b61ed5d-e8bd-431d-bf52-d127655dffab" } ``` + ## History This codebase relicensed under APLv2 and donated to the Apache CloudStack diff --git a/cloudstack/data_source_cloudstack_common_schema.go b/cloudstack/data_source_cloudstack_common_schema.go index 73210e2d..516721f0 100644 --- a/cloudstack/data_source_cloudstack_common_schema.go +++ b/cloudstack/data_source_cloudstack_common_schema.go @@ -20,7 +20,7 @@ package cloudstack import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceFiltersSchema() *schema.Schema { diff --git a/cloudstack/data_source_cloudstack_instance.go b/cloudstack/data_source_cloudstack_instance.go index a78f39b1..5c909c8a 100644 --- a/cloudstack/data_source_cloudstack_instance.go +++ b/cloudstack/data_source_cloudstack_instance.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackInstance() *schema.Resource { @@ -155,11 +155,7 @@ func instanceDescriptionAttributes(d *schema.ResourceData, instance *cloudstack. d.Set("zone_id", instance.Zoneid) d.Set("nic", []interface{}{map[string]string{"ip_address": instance.Nic[0].Ipaddress}}) - tags := make(map[string]interface{}) - for _, tag := range instance.Tags { - tags[tag.Key] = tag.Value - } - d.Set("tags", tags) + d.Set("tags", tagsToMap(instance.Tags)) return nil } diff --git a/cloudstack/data_source_cloudstack_instance_test.go b/cloudstack/data_source_cloudstack_instance_test.go index 14616488..04ec4bf9 100644 --- a/cloudstack/data_source_cloudstack_instance_test.go +++ b/cloudstack/data_source_cloudstack_instance_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) // basic acceptance to check if the display_name attribute has same value in @@ -40,7 +40,6 @@ func TestAccInstanceDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "display_name", resourceName, "display_name"), ), - ExpectNonEmptyPlan: true, }, }, }) diff --git a/cloudstack/data_source_cloudstack_ipaddress.go b/cloudstack/data_source_cloudstack_ipaddress.go index ad7b1085..997a3a26 100644 --- a/cloudstack/data_source_cloudstack_ipaddress.go +++ b/cloudstack/data_source_cloudstack_ipaddress.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackIPAddress() *schema.Resource { @@ -124,7 +124,7 @@ func ipAddressDescriptionAttributes(d *schema.ResourceData, publicIpAddress *clo d.Set("project", publicIpAddress.Project) d.Set("ip_address", publicIpAddress.Ipaddress) d.Set("is_source_nat", publicIpAddress.Issourcenat) - d.Set("tags", publicIpAddress.Tags) + d.Set("tags", tagsToMap(publicIpAddress.Tags)) return nil } diff --git a/cloudstack/data_source_cloudstack_ipaddress_test.go b/cloudstack/data_source_cloudstack_ipaddress_test.go index 2e32b618..bb576bcf 100644 --- a/cloudstack/data_source_cloudstack_ipaddress_test.go +++ b/cloudstack/data_source_cloudstack_ipaddress_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccIPAddressDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccIPAddressDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "zone_name", resourceName, "zone"), ), - ExpectNonEmptyPlan: true, }, }, }) @@ -60,6 +59,6 @@ resource "cloudstack_ipaddress" "ipaddress-resource" { } output "ipaddress-output" { - value = "${data.cloudstack_ipaddress.ipaddress-data-source}" + value = data.cloudstack_ipaddress.ipaddress-data-source } ` diff --git a/cloudstack/data_source_cloudstack_network_offering.go b/cloudstack/data_source_cloudstack_network_offering.go index 8e57fae2..fff5f56c 100644 --- a/cloudstack/data_source_cloudstack_network_offering.go +++ b/cloudstack/data_source_cloudstack_network_offering.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackNetworkOffering() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_network_offering_test.go b/cloudstack/data_source_cloudstack_network_offering_test.go index 0101b318..d8d235dd 100644 --- a/cloudstack/data_source_cloudstack_network_offering_test.go +++ b/cloudstack/data_source_cloudstack_network_offering_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccNetworkOfferingDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccNetworkOfferingDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), ), - ExpectNonEmptyPlan: true, }, }, }) diff --git a/cloudstack/data_source_cloudstack_pod.go b/cloudstack/data_source_cloudstack_pod.go index d6d211ef..77a8ca70 100644 --- a/cloudstack/data_source_cloudstack_pod.go +++ b/cloudstack/data_source_cloudstack_pod.go @@ -27,7 +27,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackPod() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_pod_test.go b/cloudstack/data_source_cloudstack_pod_test.go index 815e57e5..36334ebc 100644 --- a/cloudstack/data_source_cloudstack_pod_test.go +++ b/cloudstack/data_source_cloudstack_pod_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccPodDataSource_basic(t *testing.T) { diff --git a/cloudstack/data_source_cloudstack_service_offering.go b/cloudstack/data_source_cloudstack_service_offering.go index 4b339032..8c1272a3 100644 --- a/cloudstack/data_source_cloudstack_service_offering.go +++ b/cloudstack/data_source_cloudstack_service_offering.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackServiceOffering() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_service_offering_test.go b/cloudstack/data_source_cloudstack_service_offering_test.go index d7455396..afe94d5e 100644 --- a/cloudstack/data_source_cloudstack_service_offering_test.go +++ b/cloudstack/data_source_cloudstack_service_offering_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccServiceOfferingDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccServiceOfferingDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), ), - ExpectNonEmptyPlan: true, }, }, }) diff --git a/cloudstack/data_source_cloudstack_ssh_keypair.go b/cloudstack/data_source_cloudstack_ssh_keypair.go index c7696cbb..1cb2734f 100644 --- a/cloudstack/data_source_cloudstack_ssh_keypair.go +++ b/cloudstack/data_source_cloudstack_ssh_keypair.go @@ -27,7 +27,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackSSHKeyPair() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_ssh_keypair_test.go b/cloudstack/data_source_cloudstack_ssh_keypair_test.go index 32bd3fd0..aa4bb97f 100644 --- a/cloudstack/data_source_cloudstack_ssh_keypair_test.go +++ b/cloudstack/data_source_cloudstack_ssh_keypair_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccSshKeyPairDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccSshKeyPairDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "id", resourceName, "id"), ), - ExpectNonEmptyPlan: true, }, }, }) diff --git a/cloudstack/data_source_cloudstack_template.go b/cloudstack/data_source_cloudstack_template.go index 0025f64b..5040f9bb 100644 --- a/cloudstack/data_source_cloudstack_template.go +++ b/cloudstack/data_source_cloudstack_template.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackTemplate() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_user.go b/cloudstack/data_source_cloudstack_user.go index a40862aa..23516f1c 100644 --- a/cloudstack/data_source_cloudstack_user.go +++ b/cloudstack/data_source_cloudstack_user.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackUser() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_user_test.go b/cloudstack/data_source_cloudstack_user_test.go index aa9c14d0..0e063b9f 100644 --- a/cloudstack/data_source_cloudstack_user_test.go +++ b/cloudstack/data_source_cloudstack_user_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccUserDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccUserDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "first_name", resourceName, "first_name"), ), - ExpectNonEmptyPlan: true, }, }, }) @@ -65,6 +64,6 @@ data "cloudstack_user" "user-data-source"{ } output "user-output" { - value = "${data.cloudstack_user.user-data-source}" + value = data.cloudstack_user.user-data-source } ` diff --git a/cloudstack/data_source_cloudstack_volume.go b/cloudstack/data_source_cloudstack_volume.go index e8c6bdb0..2e548eb0 100644 --- a/cloudstack/data_source_cloudstack_volume.go +++ b/cloudstack/data_source_cloudstack_volume.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackVolume() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_volume_test.go b/cloudstack/data_source_cloudstack_volume_test.go index 810ecdff..2c0cfac1 100644 --- a/cloudstack/data_source_cloudstack_volume_test.go +++ b/cloudstack/data_source_cloudstack_volume_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccVolumeDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccVolumeDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), ), - ExpectNonEmptyPlan: true, }, }, }) @@ -60,8 +59,8 @@ data "cloudstack_zone" "zone-data-source" { resource "cloudstack_volume" "volume-resource"{ name = "TestVolume" - disk_offering_id = "${cloudstack_disk_offering.disk-offering.id}" - zone_id = "${data.cloudstack_zone.zone-data-source.id}" + disk_offering_id = cloudstack_disk_offering.disk-offering.id + zone_id = data.cloudstack_zone.zone-data-source.id } data "cloudstack_volume" "volume-data-source"{ diff --git a/cloudstack/data_source_cloudstack_vpc.go b/cloudstack/data_source_cloudstack_vpc.go index a473d99c..287acf4e 100644 --- a/cloudstack/data_source_cloudstack_vpc.go +++ b/cloudstack/data_source_cloudstack_vpc.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackVPC() *schema.Resource { @@ -123,7 +123,7 @@ func vpcDescriptionAttributes(d *schema.ResourceData, vpc *cloudstack.VPC) error d.Set("network_domain", vpc.Networkdomain) d.Set("project", vpc.Project) d.Set("zone_name", vpc.Zonename) - d.Set("tags", vpc.Tags) + d.Set("tags", tagsToMap(vpc.Tags)) return nil } diff --git a/cloudstack/data_source_cloudstack_vpc_test.go b/cloudstack/data_source_cloudstack_vpc_test.go index 40d3f86d..2ac57dd1 100644 --- a/cloudstack/data_source_cloudstack_vpc_test.go +++ b/cloudstack/data_source_cloudstack_vpc_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccVPCDataSource_basic(t *testing.T) { @@ -67,6 +67,6 @@ data "cloudstack_vpc" "vpc-data-source"{ } output "vpc-output" { -value = "${data.cloudstack_vpc.vpc-data-source}" +value = data.cloudstack_vpc.vpc-data-source } ` diff --git a/cloudstack/data_source_cloudstack_vpn_connection.go b/cloudstack/data_source_cloudstack_vpn_connection.go index c0015bf6..90bbeedc 100644 --- a/cloudstack/data_source_cloudstack_vpn_connection.go +++ b/cloudstack/data_source_cloudstack_vpn_connection.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudstackVPNConnection() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_zone.go b/cloudstack/data_source_cloudstack_zone.go index 296c887c..9fb211b2 100644 --- a/cloudstack/data_source_cloudstack_zone.go +++ b/cloudstack/data_source_cloudstack_zone.go @@ -27,7 +27,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceCloudStackZone() *schema.Resource { diff --git a/cloudstack/data_source_cloudstack_zone_test.go b/cloudstack/data_source_cloudstack_zone_test.go index b02bb48b..c51948c2 100644 --- a/cloudstack/data_source_cloudstack_zone_test.go +++ b/cloudstack/data_source_cloudstack_zone_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccZoneDataSource_basic(t *testing.T) { @@ -38,7 +38,6 @@ func TestAccZoneDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), ), - ExpectNonEmptyPlan: true, }, }, }) diff --git a/cloudstack/metadata.go b/cloudstack/metadata.go index 59f68018..635e7666 100644 --- a/cloudstack/metadata.go +++ b/cloudstack/metadata.go @@ -23,7 +23,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) // metadataSchema returns the schema to use for metadata diff --git a/cloudstack/provider.go b/cloudstack/provider.go index c35a263c..6d7b7b53 100644 --- a/cloudstack/provider.go +++ b/cloudstack/provider.go @@ -23,12 +23,10 @@ import ( "errors" "github.com/go-ini/ini" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -// Provider returns a terraform.ResourceProvider. -func Provider() terraform.ResourceProvider { +func New() *schema.Provider { return &schema.Provider{ Schema: map[string]*schema.Schema{ "api_url": { diff --git a/cloudstack/provider_test.go b/cloudstack/provider_test.go index d6726b77..0a3acf02 100644 --- a/cloudstack/provider_test.go +++ b/cloudstack/provider_test.go @@ -20,56 +20,79 @@ package cloudstack import ( + "context" "os" "testing" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-mux/tf5muxserver" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -var testAccProviders map[string]terraform.ResourceProvider +var testAccProviders map[string]*schema.Provider var testAccProvider *schema.Provider var cloudStackTemplateURL = os.Getenv("CLOUDSTACK_TEMPLATE_URL") func init() { - testAccProvider = Provider().(*schema.Provider) - testAccProviders = map[string]terraform.ResourceProvider{ + testAccProvider = New() + testAccProviders = map[string]*schema.Provider{ "cloudstack": testAccProvider, } } func TestProvider(t *testing.T) { - if err := Provider().(*schema.Provider).InternalValidate(); err != nil { + if err := New().InternalValidate(); err != nil { t.Fatalf("err: %s", err) } } func TestProvider_impl(t *testing.T) { - var _ terraform.ResourceProvider = Provider() + var _ *schema.Provider = New() } -func testSetValueOnResourceData(t *testing.T) { - d := schema.ResourceData{} - d.Set("id", "name") +func TestMuxServer(t *testing.T) { + resource.Test(t, resource.TestCase{ + ProtoV5ProviderFactories: map[string]func() (tfprotov5.ProviderServer, error){ + "cloudstack": func() (tfprotov5.ProviderServer, error) { + ctx := context.Background() + providers := []func() tfprotov5.ProviderServer{ + New().GRPCProvider, + } - setValueOrID(&d, "id", "name", "54711781-274e-41b2-83c0-17194d0108f7") + muxServer, err := tf5muxserver.NewMuxServer(ctx, providers...) - if d.Get("id").(string) != "name" { - t.Fatal("err: 'id' does not match 'name'") - } -} + if err != nil { + return nil, err + } -func testSetIDOnResourceData(t *testing.T) { - d := schema.ResourceData{} - d.Set("id", "54711781-274e-41b2-83c0-17194d0108f7") + return muxServer.ProviderServer(), nil + }, + }, + Steps: []resource.TestStep{ + { + Config: testMuxServerConfig_basic, + }, + }, + }) +} - setValueOrID(&d, "id", "name", "54711781-274e-41b2-83c0-17194d0108f7") +const testMuxServerConfig_basic = ` +resource "cloudstack_zone" "zone_resource"{ + name = "TestZone" + dns1 = "8.8.8.8" + internal_dns1 = "172.20.0.1" + network_type = "Advanced" + } - if d.Get("id").(string) != "54711781-274e-41b2-83c0-17194d0108f7" { - t.Fatal("err: 'id' does not match '54711781-274e-41b2-83c0-17194d0108f7'") - } -} + data "cloudstack_zone" "zone_data_source"{ + filter{ + name = "name" + value = cloudstack_zone.zone_resource.name + } + } + ` func testAccPreCheck(t *testing.T) { if v := os.Getenv("CLOUDSTACK_API_URL"); v == "" { diff --git a/cloudstack/resource_cloudstack_account.go b/cloudstack/resource_cloudstack_account.go index a0d950f9..2c1bea62 100644 --- a/cloudstack/resource_cloudstack_account.go +++ b/cloudstack/resource_cloudstack_account.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackAccount() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_affinity_group.go b/cloudstack/resource_cloudstack_affinity_group.go index 7b64fbe9..bb473d34 100644 --- a/cloudstack/resource_cloudstack_affinity_group.go +++ b/cloudstack/resource_cloudstack_affinity_group.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackAffinityGroup() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_affinity_group_test.go b/cloudstack/resource_cloudstack_affinity_group_test.go index 9b1eb8b4..e4c8738e 100644 --- a/cloudstack/resource_cloudstack_affinity_group_test.go +++ b/cloudstack/resource_cloudstack_affinity_group_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackAffinityGroup_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_attach_volume.go b/cloudstack/resource_cloudstack_attach_volume.go index 07892f27..5880c912 100644 --- a/cloudstack/resource_cloudstack_attach_volume.go +++ b/cloudstack/resource_cloudstack_attach_volume.go @@ -21,7 +21,7 @@ package cloudstack import ( "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackAttachVolume() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_attach_volume_test.go b/cloudstack/resource_cloudstack_attach_volume_test.go index cb79a34c..dcd3a780 100644 --- a/cloudstack/resource_cloudstack_attach_volume_test.go +++ b/cloudstack/resource_cloudstack_attach_volume_test.go @@ -22,7 +22,7 @@ package cloudstack import ( "testing" - "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccCloudstackAttachVolume_basic(t *testing.T) { @@ -43,6 +43,7 @@ func TestAccCloudstackAttachVolume_basic(t *testing.T) { const testAccCloudstackAttachVolume_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -52,16 +53,16 @@ resource "cloudstack_network" "foo" { name = "terraform-test" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_disk" "foo" { name = "terraform-disk" disk_offering = "Small" - zone = "${cloudstack_instance.foobar.zone}" + zone = cloudstack_instance.foobar.zone } resource "cloudstack_attach_volume" "foo" { diff --git a/cloudstack/resource_cloudstack_autoscale_vm_profile.go b/cloudstack/resource_cloudstack_autoscale_vm_profile.go index f9d7cde4..04fc5d5f 100644 --- a/cloudstack/resource_cloudstack_autoscale_vm_profile.go +++ b/cloudstack/resource_cloudstack_autoscale_vm_profile.go @@ -22,12 +22,11 @@ package cloudstack import ( "fmt" "log" - "net/url" "strings" "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackAutoScaleVMProfile() *schema.Resource { @@ -101,16 +100,15 @@ func resourceCloudStackAutoScaleVMProfileCreate(d *schema.ResourceData, meta int if err != nil { return err } - p.SetDestroyvmgraceperiod(int(duration.Seconds())) + p.SetExpungevmgraceperiod(int(duration.Seconds())) } if v, ok := d.GetOk("other_deploy_params"); ok { - otherMap := v.(map[string]interface{}) - result := url.Values{} - for k, v := range otherMap { - result.Set(k, fmt.Sprint(v)) + nv := make(map[string]string) + for k, v := range v.(map[string]interface{}) { + nv[k] = v.(string) } - p.SetOtherdeployparams(result.Encode()) + p.SetOtherdeployparams(nv) } // Create the new vm profile @@ -164,19 +162,10 @@ func resourceCloudStackAutoScaleVMProfileRead(d *schema.ResourceData, meta inter setValueOrID(d, "template", template.Name, p.Templateid) setValueOrID(d, "zone", zone.Name, p.Zoneid) - d.Set("destroy_vm_grace_period", (time.Duration(p.Destroyvmgraceperiod) * time.Second).String()) + d.Set("destroy_vm_grace_period", (time.Duration(p.Expungevmgraceperiod) * time.Second).String()) - if p.Otherdeployparams != "" { - var values url.Values - values, err = url.ParseQuery(p.Otherdeployparams) - if err != nil { - return err - } - otherParams := make(map[string]interface{}, len(values)) - for key := range values { - otherParams[key] = values.Get(key) - } - d.Set("other_deploy_params", otherParams) + if p.Otherdeployparams != nil { + d.Set("other_deploy_params", p.Otherdeployparams) } metadata, err := getMetadata(cs, d, "AutoScaleVmProfile") @@ -211,7 +200,7 @@ func resourceCloudStackAutoScaleVMProfileUpdate(d *schema.ResourceData, meta int if err != nil { return err } - p.SetDestroyvmgraceperiod(int(duration.Seconds())) + p.SetExpungevmgraceperiod(int(duration.Seconds())) } _, err := cs.AutoScale.UpdateAutoScaleVmProfile(p) diff --git a/cloudstack/resource_cloudstack_autoscale_vm_profile_test.go b/cloudstack/resource_cloudstack_autoscale_vm_profile_test.go index 06d60ac5..f417f45c 100644 --- a/cloudstack/resource_cloudstack_autoscale_vm_profile_test.go +++ b/cloudstack/resource_cloudstack_autoscale_vm_profile_test.go @@ -21,11 +21,12 @@ package cloudstack import ( "fmt" + "reflect" "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackAutoscaleVMProfile_basic(t *testing.T) { @@ -162,7 +163,10 @@ func testAccCheckCloudStackAutoscaleVMProfileBasicAttributes( return fmt.Errorf("Bad zone: %s", vmProfile.Zoneid) } - if vmProfile.Otherdeployparams != "displayname=display1&networkids=net1" { + if reflect.DeepEqual(vmProfile.Otherdeployparams, map[string]string{ + "displayname": "display1", + "networkids": "net1", + }) { return fmt.Errorf("Bad otherdeployparams: %s", vmProfile.Otherdeployparams) } @@ -174,8 +178,8 @@ func testAccCheckCloudStackAutoscaleVMProfileUpdatedAttributes( vmProfile *cloudstack.AutoScaleVmProfile) resource.TestCheckFunc { return func(s *terraform.State) error { - if vmProfile.Destroyvmgraceperiod != 10 { - return fmt.Errorf("Bad destroy_vm_grace_period: %d", vmProfile.Destroyvmgraceperiod) + if vmProfile.Expungevmgraceperiod != 10 { + return fmt.Errorf("Bad destroy_vm_grace_period: %d", vmProfile.Expungevmgraceperiod) } return nil diff --git a/cloudstack/resource_cloudstack_disk.go b/cloudstack/resource_cloudstack_disk.go index 24535835..dc325bca 100644 --- a/cloudstack/resource_cloudstack_disk.go +++ b/cloudstack/resource_cloudstack_disk.go @@ -24,7 +24,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackDisk() *schema.Resource { @@ -105,7 +105,6 @@ func resourceCloudStackDisk() *schema.Resource { func resourceCloudStackDiskCreate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) name := d.Get("name").(string) @@ -145,14 +144,6 @@ func resourceCloudStackDiskCreate(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error creating the new disk %s: %s", name, err) } - d.SetPartial("name") - d.SetPartial("device_id") - d.SetPartial("disk_offering") - d.SetPartial("size") - d.SetPartial("virtual_machine_id") - d.SetPartial("project") - d.SetPartial("zone") - // Set the volume ID and partials d.SetId(r.Id) @@ -161,7 +152,6 @@ func resourceCloudStackDiskCreate(d *schema.ResourceData, meta interface{}) erro if err != nil { return fmt.Errorf("Error setting tags on the new disk %s: %s", name, err) } - d.SetPartial("tags") if d.Get("attach").(bool) { if err := resourceCloudStackDiskAttach(d, meta); err != nil { @@ -169,10 +159,8 @@ func resourceCloudStackDiskCreate(d *schema.ResourceData, meta interface{}) erro } // Set the additional partial - d.SetPartial("attach") } - d.Partial(false) return resourceCloudStackDiskRead(d, meta) } @@ -217,7 +205,6 @@ func resourceCloudStackDiskRead(d *schema.ResourceData, meta interface{}) error func resourceCloudStackDiskUpdate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) name := d.Get("name").(string) @@ -257,8 +244,6 @@ func resourceCloudStackDiskUpdate(d *schema.ResourceData, meta interface{}) erro // Update the volume ID and set partials d.SetId(r.Id) - d.SetPartial("disk_offering") - d.SetPartial("size") } // If the device ID changed, just detach here so we can re-attach the @@ -278,9 +263,6 @@ func resourceCloudStackDiskUpdate(d *schema.ResourceData, meta interface{}) erro } // Set the additional partials - d.SetPartial("attach") - d.SetPartial("device_id") - d.SetPartial("virtual_machine_id") } else { // Detach the volume if err := resourceCloudStackDiskDetach(d, meta); err != nil { @@ -294,11 +276,8 @@ func resourceCloudStackDiskUpdate(d *schema.ResourceData, meta interface{}) erro if err != nil { return fmt.Errorf("Error updating tags on disk %s: %s", name, err) } - d.SetPartial("tags") } - d.Partial(false) - return resourceCloudStackDiskRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_disk_offering.go b/cloudstack/resource_cloudstack_disk_offering.go index daa6b889..197eaf4b 100644 --- a/cloudstack/resource_cloudstack_disk_offering.go +++ b/cloudstack/resource_cloudstack_disk_offering.go @@ -23,7 +23,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackDiskOffering() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_disk_test.go b/cloudstack/resource_cloudstack_disk_test.go index 3d182a12..76031a62 100644 --- a/cloudstack/resource_cloudstack_disk_test.go +++ b/cloudstack/resource_cloudstack_disk_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackDisk_basic(t *testing.T) { @@ -228,6 +228,7 @@ resource "cloudstack_disk" "foo" { const testAccCloudStackDisk_deviceID = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -237,9 +238,9 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } @@ -248,6 +249,6 @@ resource "cloudstack_disk" "foo" { attach = true device_id = 4 disk_offering = "Small" - virtual_machine_id = "${cloudstack_instance.foobar.id}" - zone = "${cloudstack_instance.foobar.zone}" + virtual_machine_id = cloudstack_instance.foobar.id + zone = cloudstack_instance.foobar.zone }` diff --git a/cloudstack/resource_cloudstack_domain.go b/cloudstack/resource_cloudstack_domain.go index 4123a6e6..3e11b1a7 100644 --- a/cloudstack/resource_cloudstack_domain.go +++ b/cloudstack/resource_cloudstack_domain.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackDomain() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_egress_firewall.go b/cloudstack/resource_cloudstack_egress_firewall.go index 5994cdd0..9b7f3946 100644 --- a/cloudstack/resource_cloudstack_egress_firewall.go +++ b/cloudstack/resource_cloudstack_egress_firewall.go @@ -28,7 +28,7 @@ import ( "github.com/apache/cloudstack-go/v2/cloudstack" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackEgressFirewall() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_egress_firewall_test.go b/cloudstack/resource_cloudstack_egress_firewall_test.go index 6a5de880..28b664f7 100644 --- a/cloudstack/resource_cloudstack_egress_firewall_test.go +++ b/cloudstack/resource_cloudstack_egress_firewall_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackEgressFirewall_basic(t *testing.T) { @@ -42,11 +42,11 @@ func TestAccCloudStackEgressFirewall_basic(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_egress_firewall.foo", "rule.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.3342666485.cidr_list.140834516", "10.1.1.10/32"), + "cloudstack_egress_firewall.foo", "rule.0.cidr_list.0", "10.1.1.10/32"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.3342666485.protocol", "tcp"), + "cloudstack_egress_firewall.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.3342666485.ports.32925333", "8080"), + "cloudstack_egress_firewall.foo", "rule.0.ports.0", "8080"), ), }, }, @@ -66,11 +66,11 @@ func TestAccCloudStackEgressFirewall_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_egress_firewall.foo", "rule.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.3342666485.cidr_list.140834516", "10.1.1.10/32"), + "cloudstack_egress_firewall.foo", "rule.0.cidr_list.0", "10.1.1.10/32"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.3342666485.protocol", "tcp"), + "cloudstack_egress_firewall.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.3342666485.ports.32925333", "8080"), + "cloudstack_egress_firewall.foo", "rule.0.ports.0", "8080"), ), }, @@ -81,19 +81,19 @@ func TestAccCloudStackEgressFirewall_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_egress_firewall.foo", "rule.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.1558935996.cidr_list.140834516", "10.1.1.10/32"), + "cloudstack_egress_firewall.foo", "rule.0.cidr_list.0", "10.1.1.10/32"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.1558935996.cidr_list.2966983089", "10.1.1.11/32"), + "cloudstack_egress_firewall.foo", "rule.0.cidr_list.1", "10.1.1.11/32"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.1558935996.protocol", "tcp"), + "cloudstack_egress_firewall.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.1558935996.ports.32925333", "8080"), + "cloudstack_egress_firewall.foo", "rule.0.ports.0", "8080"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.2961518528.cidr_list.140834516", "10.1.1.10/32"), + "cloudstack_egress_firewall.foo", "rule.1.cidr_list.0", "10.1.1.10/32"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.2961518528.protocol", "tcp"), + "cloudstack_egress_firewall.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_egress_firewall.foo", "rule.2961518528.ports.1889509032", "80"), + "cloudstack_egress_firewall.foo", "rule.1.ports.1", "80"), ), }, }, @@ -162,13 +162,14 @@ func testAccCheckCloudStackEgressFirewallDestroy(s *terraform.State) error { const testAccCloudStackEgressFirewall_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" } resource "cloudstack_egress_firewall" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id rule { cidr_list = ["10.1.1.10/32"] @@ -180,13 +181,14 @@ resource "cloudstack_egress_firewall" "foo" { const testAccCloudStackEgressFirewall_update = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" } resource "cloudstack_egress_firewall" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id rule { cidr_list = ["10.1.1.10/32", "10.1.1.11/32"] diff --git a/cloudstack/resource_cloudstack_firewall.go b/cloudstack/resource_cloudstack_firewall.go index dbd922b6..b7ba7e0b 100644 --- a/cloudstack/resource_cloudstack_firewall.go +++ b/cloudstack/resource_cloudstack_firewall.go @@ -28,7 +28,7 @@ import ( "github.com/apache/cloudstack-go/v2/cloudstack" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackFirewall() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_firewall_test.go b/cloudstack/resource_cloudstack_firewall_test.go index 8fd66068..f43e3a0d 100644 --- a/cloudstack/resource_cloudstack_firewall_test.go +++ b/cloudstack/resource_cloudstack_firewall_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackFirewall_basic(t *testing.T) { @@ -42,19 +42,19 @@ func TestAccCloudStackFirewall_basic(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_firewall.foo", "rule.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.2263505090.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_firewall.foo", "rule.1.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.2263505090.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.2263505090.ports.32925333", "8080"), + "cloudstack_firewall.foo", "rule.1.ports.0", "8080"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_firewall.foo", "rule.0.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.ports.1209010669", "1000-2000"), + "cloudstack_firewall.foo", "rule.0.ports.0", "1000-2000"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.ports.1889509032", "80"), + "cloudstack_firewall.foo", "rule.0.ports.1", "80"), ), }, }, @@ -74,19 +74,19 @@ func TestAccCloudStackFirewall_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_firewall.foo", "rule.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.2263505090.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_firewall.foo", "rule.1.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.2263505090.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.2263505090.ports.32925333", "8080"), + "cloudstack_firewall.foo", "rule.1.ports.0", "8080"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_firewall.foo", "rule.0.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.ports.1209010669", "1000-2000"), + "cloudstack_firewall.foo", "rule.0.ports.0", "1000-2000"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.ports.1889509032", "80"), + "cloudstack_firewall.foo", "rule.0.ports.1", "80"), ), }, @@ -97,29 +97,29 @@ func TestAccCloudStackFirewall_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_firewall.foo", "rule.#", "3"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3529885171.cidr_list.80081744", "10.0.1.0/24"), + "cloudstack_firewall.foo", "rule.0.cidr_list.1", "10.0.1.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3529885171.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_firewall.foo", "rule.0.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3529885171.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3529885171.ports.32925333", "8080"), + "cloudstack_firewall.foo", "rule.0.ports.0", "8080"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_firewall.foo", "rule.1.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.ports.1209010669", "1000-2000"), + "cloudstack_firewall.foo", "rule.1.ports.0", "1000-2000"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.3782201428.ports.1889509032", "80"), + "cloudstack_firewall.foo", "rule.1.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.4160426500.cidr_list.2835005819", "172.16.100.0/24"), + "cloudstack_firewall.foo", "rule.2.cidr_list.0", "172.16.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.4160426500.protocol", "tcp"), + "cloudstack_firewall.foo", "rule.2.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.4160426500.ports.1889509032", "80"), + "cloudstack_firewall.foo", "rule.2.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_firewall.foo", "rule.4160426500.ports.3638101695", "443"), + "cloudstack_firewall.foo", "rule.2.ports.0", "443"), ), }, }, @@ -188,14 +188,15 @@ func testAccCheckCloudStackFirewallDestroy(s *terraform.State) error { const testAccCloudStackFirewall_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" - source_nat_ip = true + source_nat_ip = true zone = "Sandbox-simulator" } resource "cloudstack_firewall" "foo" { - ip_address_id = "${cloudstack_network.foo.source_nat_ip_id}" + ip_address_id = cloudstack_network.foo.source_nat_ip_id rule { cidr_list = ["10.0.0.0/24"] @@ -213,14 +214,15 @@ resource "cloudstack_firewall" "foo" { const testAccCloudStackFirewall_update = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" - source_nat_ip = true + source_nat_ip = true zone = "Sandbox-simulator" } resource "cloudstack_firewall" "foo" { - ip_address_id = "${cloudstack_network.foo.source_nat_ip_id}" + ip_address_id = cloudstack_network.foo.source_nat_ip_id rule { cidr_list = ["10.0.0.0/24", "10.0.1.0/24"] diff --git a/cloudstack/resource_cloudstack_host.go b/cloudstack/resource_cloudstack_host.go index 46fc8e2b..3e88d728 100644 --- a/cloudstack/resource_cloudstack_host.go +++ b/cloudstack/resource_cloudstack_host.go @@ -28,7 +28,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackHost() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_host_test.go b/cloudstack/resource_cloudstack_host_test.go index 8da6f58c..da91b8ab 100644 --- a/cloudstack/resource_cloudstack_host_test.go +++ b/cloudstack/resource_cloudstack_host_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackHost_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_instance.go b/cloudstack/resource_cloudstack_instance.go index bd69e838..a4e2caec 100644 --- a/cloudstack/resource_cloudstack_instance.go +++ b/cloudstack/resource_cloudstack_instance.go @@ -28,7 +28,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackInstance() *schema.Resource { @@ -482,11 +482,7 @@ func resourceCloudStackInstanceRead(d *schema.ResourceData, meta interface{}) er d.Set("security_group_names", groups) } - tags := make(map[string]interface{}) - for _, tag := range vm.Tags { - tags[tag.Key] = tag.Value - } - d.Set("tags", tags) + d.Set("tags", tagsToMap(vm.Tags)) setValueOrID(d, "service_offering", vm.Serviceofferingname, vm.Serviceofferingid) setValueOrID(d, "template", vm.Templatename, vm.Templateid) @@ -498,7 +494,6 @@ func resourceCloudStackInstanceRead(d *schema.ResourceData, meta interface{}) er func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) name := d.Get("name").(string) @@ -519,7 +514,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) "Error updating the display name for instance %s: %s", name, err) } - d.SetPartial("display_name") } // Check if the group is changed and if so, update the virtual machine @@ -539,7 +533,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) "Error updating the group for instance %s: %s", name, err) } - d.SetPartial("group") } // Attributes that require reboot to update @@ -570,7 +563,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) "Error updating the name for instance %s: %s", name, err) } - d.SetPartial("name") } // Check if the service offering is changed and if so, update the offering @@ -592,7 +584,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf( "Error changing the service offering for instance %s: %s", name, err) } - d.SetPartial("service_offering") } // Check if the affinity group IDs have changed and if so, update the IDs @@ -615,7 +606,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf( "Error updating the affinity groups for instance %s: %s", name, err) } - d.SetPartial("affinity_group_ids") } // Check if the affinity group names have changed and if so, update the names @@ -638,14 +628,17 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf( "Error updating the affinity groups for instance %s: %s", name, err) } - d.SetPartial("affinity_group_names") } // Check if the keypair has changed and if so, update the keypair if d.HasChange("keypair") { log.Printf("[DEBUG] SSH keypair changed for %s, starting update", name) - p := cs.SSH.NewResetSSHKeyForVirtualMachineParams(d.Id(), d.Get("keypair").(string)) + p := cs.SSH.NewResetSSHKeyForVirtualMachineParams(d.Id()) + + if keypair, ok := d.GetOk("keypair"); ok { + p.SetKeypair(keypair.(string)) + } // If there is a project supplied, we retrieve and set the project id if err := setProjectid(p, cs, d); err != nil { @@ -657,7 +650,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf( "Error changing the SSH keypair for instance %s: %s", name, err) } - d.SetPartial("keypair") } // Check if the user data has changed and if so, update the user data @@ -676,7 +668,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf( "Error updating user_data for instance %s: %s", name, err) } - d.SetPartial("user_data") } // Start the virtual machine again @@ -693,7 +684,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) if err := updateTags(cs, d, "UserVm"); err != nil { return fmt.Errorf("Error updating tags on instance %s: %s", name, err) } - d.SetPartial("tags") } // Check if the details have changed and if so, update the details @@ -708,8 +698,6 @@ func resourceCloudStackInstanceUpdate(d *schema.ResourceData, meta interface{}) p.SetDetails(vmDetails) } - d.Partial(false) - return resourceCloudStackInstanceRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_instance_test.go b/cloudstack/resource_cloudstack_instance_test.go index 86e8fbc2..38307dc3 100644 --- a/cloudstack/resource_cloudstack_instance_test.go +++ b/cloudstack/resource_cloudstack_instance_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackInstance_basic(t *testing.T) { @@ -312,6 +312,7 @@ func testAccCheckCloudStackInstanceDestroy(s *terraform.State) error { const testAccCloudStackInstance_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -321,7 +322,7 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-test" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" user_data = "foobar\nfoo\nbar" @@ -334,6 +335,7 @@ resource "cloudstack_instance" "foobar" { const testAccCloudStackInstance_stopped = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -343,7 +345,7 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-test" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" start_vm = false @@ -353,6 +355,7 @@ resource "cloudstack_instance" "foobar" { const testAccCloudStackInstance_renameAndResize = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -362,7 +365,7 @@ resource "cloudstack_instance" "foobar" { name = "terraform-updated" display_name = "terraform-updated" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" user_data = "foobar\nfoo\nbar" @@ -372,6 +375,7 @@ resource "cloudstack_instance" "foobar" { const testAccCloudStackInstance_fixedIP = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -381,7 +385,7 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-test" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id ip_address = "10.1.1.123" template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" @@ -391,6 +395,7 @@ resource "cloudstack_instance" "foobar" { const testAccCloudStackInstance_keyPair = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -404,16 +409,17 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-test" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" - keypair = "${cloudstack_ssh_keypair.foo.name}" + keypair = cloudstack_ssh_keypair.foo.name expunge = true }` const testAccCloudStackInstance_project = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" project = "terraform" @@ -424,9 +430,9 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-test" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" project = "terraform" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true }` diff --git a/cloudstack/resource_cloudstack_ipaddress.go b/cloudstack/resource_cloudstack_ipaddress.go index 10a7c73a..c7db4ac0 100644 --- a/cloudstack/resource_cloudstack_ipaddress.go +++ b/cloudstack/resource_cloudstack_ipaddress.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackIPAddress() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_ipaddress_test.go b/cloudstack/resource_cloudstack_ipaddress_test.go index 98a32f6b..82b8ffce 100644 --- a/cloudstack/resource_cloudstack_ipaddress_test.go +++ b/cloudstack/resource_cloudstack_ipaddress_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackIPAddress_basic(t *testing.T) { @@ -137,6 +137,7 @@ func testAccCheckCloudStackIPAddressDestroy(s *terraform.State) error { const testAccCloudStackIPAddress_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" source_nat_ip = true @@ -144,7 +145,7 @@ resource "cloudstack_network" "foo" { } resource "cloudstack_ipaddress" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id tags = { terraform-tag = "true" } @@ -159,8 +160,8 @@ resource "cloudstack_vpc" "foo" { } resource "cloudstack_ipaddress" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + zone = cloudstack_vpc.foo.zone }` const testAccCloudStackIPAddress_vpcid_with_network_id = ` @@ -173,6 +174,7 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" source_nat_ip = true @@ -180,7 +182,7 @@ resource "cloudstack_network" "foo" { } resource "cloudstack_ipaddress" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" - network_id = "${cloudstack_network.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + network_id = cloudstack_network.foo.id + zone = cloudstack_vpc.foo.zone }` diff --git a/cloudstack/resource_cloudstack_kubernetes_cluster.go b/cloudstack/resource_cloudstack_kubernetes_cluster.go index e182ea3d..18a07b50 100644 --- a/cloudstack/resource_cloudstack_kubernetes_cluster.go +++ b/cloudstack/resource_cloudstack_kubernetes_cluster.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackKubernetesCluster() *schema.Resource { @@ -259,7 +259,6 @@ func autoscaleKubernetesCluster(d *schema.ResourceData, meta interface{}) error func resourceCloudStackKubernetesClusterUpdate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) if d.HasChange("service_offering") || d.HasChange("size") { p := cs.Kubernetes.NewScaleKubernetesClusterParams(d.Id()) @@ -274,8 +273,6 @@ func resourceCloudStackKubernetesClusterUpdate(d *schema.ResourceData, meta inte return fmt.Errorf( "Error Scaling Kubernetes Cluster %s: %s", d.Id(), err) } - d.SetPartial("service_offering") - d.SetPartial("size") } if d.HasChange("autoscaling_enabled") || d.HasChange("min_size") || d.HasChange("max_size") { @@ -283,9 +280,6 @@ func resourceCloudStackKubernetesClusterUpdate(d *schema.ResourceData, meta inte if err != nil { return err } - d.SetPartial("autoscaling_enabled") - d.SetPartial("min_size") - d.SetPartial("max_size") } if d.HasChange("kubernetes_version") { @@ -299,7 +293,6 @@ func resourceCloudStackKubernetesClusterUpdate(d *schema.ResourceData, meta inte return fmt.Errorf( "Error Upgrading Kubernetes Cluster %s: %s", d.Id(), err) } - d.SetPartial("kubernetes_version") } if d.HasChange("state") { @@ -322,10 +315,8 @@ func resourceCloudStackKubernetesClusterUpdate(d *schema.ResourceData, meta inte default: return fmt.Errorf("State must either be 'Running' or 'Stopped'") } - d.SetPartial("state") } - d.Partial(false) return resourceCloudStackKubernetesClusterRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_kubernetes_version.go b/cloudstack/resource_cloudstack_kubernetes_version.go index 098ab904..a389d3a1 100644 --- a/cloudstack/resource_cloudstack_kubernetes_version.go +++ b/cloudstack/resource_cloudstack_kubernetes_version.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackKubernetesVersion() *schema.Resource { @@ -169,7 +169,6 @@ func resourceCloudStackKubernetesVersionRead(d *schema.ResourceData, meta interf func resourceCloudStackKubernetesVersionUpdate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) if d.HasChange("state") { p := cs.Kubernetes.NewUpdateKubernetesSupportedVersionParams(d.Id(), d.Get("state").(string)) @@ -178,10 +177,8 @@ func resourceCloudStackKubernetesVersionUpdate(d *schema.ResourceData, meta inte return fmt.Errorf( "Error Updating Kubernetes Version %s: %s", d.Id(), err) } - d.SetPartial("state") } - d.Partial(false) return resourceCloudStackKubernetesVersionRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_kubernetes_version_test.go b/cloudstack/resource_cloudstack_kubernetes_version_test.go index 182de0d4..a80c8139 100644 --- a/cloudstack/resource_cloudstack_kubernetes_version_test.go +++ b/cloudstack/resource_cloudstack_kubernetes_version_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackKubernetesVersion_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_loadbalancer_rule.go b/cloudstack/resource_cloudstack_loadbalancer_rule.go index 4eb0a0dd..381352c3 100644 --- a/cloudstack/resource_cloudstack_loadbalancer_rule.go +++ b/cloudstack/resource_cloudstack_loadbalancer_rule.go @@ -22,10 +22,11 @@ package cloudstack import ( "fmt" "log" + "strconv" "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackLoadBalancerRule() *schema.Resource { @@ -114,8 +115,6 @@ func resourceCloudStackLoadBalancerRuleCreate(d *schema.ResourceData, meta inter return err } - d.Partial(true) - // Create a new parameter struct p := cs.LoadBalancer.NewCreateLoadBalancerRuleParams( d.Get("algorithm").(string), @@ -155,14 +154,6 @@ func resourceCloudStackLoadBalancerRuleCreate(d *schema.ResourceData, meta inter // Set the load balancer rule ID and set partials d.SetId(r.Id) - d.SetPartial("name") - d.SetPartial("description") - d.SetPartial("ip_address_id") - d.SetPartial("network_id") - d.SetPartial("algorithm") - d.SetPartial("private_port") - d.SetPartial("public_port") - d.SetPartial("protocol") if certificateID, ok := d.GetOk("certificate_id"); ok { // Create a new parameter struct @@ -171,7 +162,6 @@ func resourceCloudStackLoadBalancerRuleCreate(d *schema.ResourceData, meta inter return err } } - d.SetPartial("certificate_id") // Create a new parameter struct mp := cs.LoadBalancer.NewAssignToLoadBalancerRuleParams(r.Id) @@ -188,9 +178,6 @@ func resourceCloudStackLoadBalancerRuleCreate(d *schema.ResourceData, meta inter return err } - d.SetPartial("member_ids") - d.Partial(false) - return resourceCloudStackLoadBalancerRuleRead(d, meta) } @@ -212,11 +199,21 @@ func resourceCloudStackLoadBalancerRuleRead(d *schema.ResourceData, meta interfa return err } + public_port, err := strconv.Atoi(lb.Publicport) + if err != nil { + return err + } + + private_port, err := strconv.Atoi(lb.Privateport) + if err != nil { + return err + } + d.Set("name", lb.Name) d.Set("ip_address_id", lb.Publicipid) d.Set("algorithm", lb.Algorithm) - d.Set("public_port", lb.Publicport) - d.Set("private_port", lb.Privateport) + d.Set("public_port", public_port) + d.Set("private_port", private_port) d.Set("protocol", lb.Protocol) // Only set network if user specified it to avoid spurious diffs diff --git a/cloudstack/resource_cloudstack_loadbalancer_rule_test.go b/cloudstack/resource_cloudstack_loadbalancer_rule_test.go index 3351a4ca..276c7569 100644 --- a/cloudstack/resource_cloudstack_loadbalancer_rule_test.go +++ b/cloudstack/resource_cloudstack_loadbalancer_rule_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackLoadBalancerRule_basic(t *testing.T) { @@ -262,6 +262,7 @@ func testAccCheckCloudStackLoadBalancerRuleDestroy(s *terraform.State) error { const testAccCloudStackLoadBalancerRule_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" source_nat_ip = true @@ -269,31 +270,32 @@ resource "cloudstack_network" "foo" { } resource "cloudstack_ipaddress" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id } resource "cloudstack_instance" "foobar1" { name = "terraform-server1" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_loadbalancer_rule" "foo" { name = "terraform-lb" - ip_address_id = "${cloudstack_ipaddress.foo.id}" + ip_address_id = cloudstack_ipaddress.foo.id algorithm = "roundrobin" public_port = 80 private_port = 80 - member_ids = ["${cloudstack_instance.foobar1.id}"] + member_ids = [cloudstack_instance.foobar1.id] }` const testAccCloudStackLoadBalancerRule_update = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" source_nat_ip = true @@ -301,31 +303,32 @@ resource "cloudstack_network" "foo" { } resource "cloudstack_ipaddress" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id } resource "cloudstack_instance" "foobar1" { name = "terraform-server1" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_loadbalancer_rule" "foo" { name = "terraform-lb-update" - ip_address_id = "${cloudstack_ipaddress.foo.id}" + ip_address_id = cloudstack_ipaddress.foo.id algorithm = "leastconn" public_port = 80 private_port = 80 - member_ids = ["${cloudstack_instance.foobar1.id}"] + member_ids = [cloudstack_instance.foobar1.id] }` const testAccCloudStackLoadBalancerRule_forcenew = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" source_nat_ip = true @@ -333,27 +336,27 @@ resource "cloudstack_network" "foo" { } resource "cloudstack_ipaddress" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id } resource "cloudstack_instance" "foobar1" { name = "terraform-server1" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_loadbalancer_rule" "foo" { name = "terraform-lb-update" - ip_address_id = "${cloudstack_ipaddress.foo.id}" + ip_address_id = cloudstack_ipaddress.foo.id algorithm = "leastconn" public_port = 443 private_port = 443 - protocol = "tcp-proxy" - member_ids = ["${cloudstack_instance.foobar1.id}"] + protocol = "tcp-proxy" + member_ids = [cloudstack_instance.foobar1.id] }` const testAccCloudStackLoadBalancerRule_vpc = ` @@ -366,35 +369,36 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" - vpc_id = "${cloudstack_vpc.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + zone = cloudstack_vpc.foo.zone } resource "cloudstack_ipaddress" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + zone = cloudstack_vpc.foo.zone } resource "cloudstack_instance" "foobar1" { name = "terraform-server1" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_loadbalancer_rule" "foo" { name = "terraform-lb" - ip_address_id = "${cloudstack_ipaddress.foo.id}" + ip_address_id = cloudstack_ipaddress.foo.id algorithm = "roundrobin" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id public_port = 80 private_port = 80 - member_ids = ["${cloudstack_instance.foobar1.id}"] + member_ids = [cloudstack_instance.foobar1.id] }` const testAccCloudStackLoadBalancerRule_vpc_update = ` @@ -407,24 +411,25 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" - vpc_id = "${cloudstack_vpc.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + zone = cloudstack_vpc.foo.zone } resource "cloudstack_ipaddress" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + zone = cloudstack_vpc.foo.zone } resource "cloudstack_instance" "foobar1" { name = "terraform-server1" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } @@ -432,18 +437,18 @@ resource "cloudstack_instance" "foobar2" { name = "terraform-server2" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_loadbalancer_rule" "foo" { name = "terraform-lb-update" - ip_address_id = "${cloudstack_ipaddress.foo.id}" + ip_address_id = cloudstack_ipaddress.foo.id algorithm = "leastconn" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id public_port = 443 private_port = 443 - member_ids = ["${cloudstack_instance.foobar1.id}", "${cloudstack_instance.foobar2.id}"] + member_ids = [cloudstack_instance.foobar1.id, cloudstack_instance.foobar2.id] }` diff --git a/cloudstack/resource_cloudstack_network.go b/cloudstack/resource_cloudstack_network.go index 405b9a22..e7329f82 100644 --- a/cloudstack/resource_cloudstack_network.go +++ b/cloudstack/resource_cloudstack_network.go @@ -27,7 +27,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const none = "none" @@ -160,7 +160,6 @@ func resourceCloudStackNetwork() *schema.Resource { func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) name := d.Get("name").(string) @@ -176,14 +175,14 @@ func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) e return e.Error() } - // Compute/set the display text - displaytext, ok := d.GetOk("display_text") - if !ok { - displaytext = name - } - // Create a new parameter struct - p := cs.Network.NewCreateNetworkParams(displaytext.(string), name, networkofferingid, zoneid) + p := cs.Network.NewCreateNetworkParams(name, networkofferingid, zoneid) + + if displaytext, ok := d.GetOk("display_text"); ok { + p.SetDisplaytext(displaytext.(string)) + } else { + p.SetDisplaytext(name) + } // Get the network offering to check if it supports specifying IP ranges no, _, err := cs.NetworkOffering.GetNetworkOfferingByID(networkofferingid) @@ -242,27 +241,12 @@ func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error creating network %s: %s", name, err) } - d.SetPartial("name") - d.SetPartial("display_text") - d.SetPartial("cidr") - d.SetPartial("gateway") - d.SetPartial("startip") - d.SetPartial("endip") - d.SetPartial("network_domain") - d.SetPartial("network_offering") - d.SetPartial("vlan") - d.SetPartial("vpc_id") - d.SetPartial("acl_id") - d.SetPartial("project") - d.SetPartial("zone") - d.SetId(r.Id) // Set tags if necessary if err = setTags(cs, d, "network"); err != nil { return fmt.Errorf("Error setting tags: %v", err) } - d.SetPartial("tags") if d.Get("source_nat_ip").(bool) { // Create a new parameter struct @@ -291,12 +275,8 @@ func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) e d.Set("source_nat_ip_id", ip.Id) // Set the additional partial - d.SetPartial("source_nat_ip") - d.SetPartial("source_nat_ip_address") - d.SetPartial("source_nat_ip_id") } - d.Partial(false) return resourceCloudStackNetworkRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_network_acl.go b/cloudstack/resource_cloudstack_network_acl.go index 2c5a5674..a895d332 100644 --- a/cloudstack/resource_cloudstack_network_acl.go +++ b/cloudstack/resource_cloudstack_network_acl.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackNetworkACL() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_network_acl_rule.go b/cloudstack/resource_cloudstack_network_acl_rule.go index f2daac74..8740df00 100644 --- a/cloudstack/resource_cloudstack_network_acl_rule.go +++ b/cloudstack/resource_cloudstack_network_acl_rule.go @@ -29,7 +29,7 @@ import ( "github.com/apache/cloudstack-go/v2/cloudstack" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackNetworkACLRule() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_network_acl_rule_test.go b/cloudstack/resource_cloudstack_network_acl_rule_test.go index 8eb76aa5..0fcc6916 100644 --- a/cloudstack/resource_cloudstack_network_acl_rule_test.go +++ b/cloudstack/resource_cloudstack_network_acl_rule_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackNetworkACLRule_basic(t *testing.T) { @@ -42,31 +42,31 @@ func TestAccCloudStackNetworkACLRule_basic(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_network_acl_rule.foo", "rule.#", "3"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.action", "allow"), + "cloudstack_network_acl_rule.foo", "rule.0.action", "allow"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.cidr_list.2835005819", "172.16.100.0/24"), + "cloudstack_network_acl_rule.foo", "rule.0.cidr_list.0", "172.16.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.protocol", "tcp"), + "cloudstack_network_acl_rule.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.ports.#", "2"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.ports.1889509032", "80"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.ports.3638101695", "443"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.0", "443"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.traffic_type", "ingress"), + "cloudstack_network_acl_rule.foo", "rule.0.traffic_type", "ingress"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.action", "allow"), + "cloudstack_network_acl_rule.foo", "rule.1.action", "allow"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.cidr_list.#", "1"), + "cloudstack_network_acl_rule.foo", "rule.1.cidr_list.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_network_acl_rule.foo", "rule.1.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.icmp_code", "-1"), + "cloudstack_network_acl_rule.foo", "rule.1.icmp_code", "-1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.icmp_type", "-1"), + "cloudstack_network_acl_rule.foo", "rule.1.icmp_type", "-1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.traffic_type", "ingress"), + "cloudstack_network_acl_rule.foo", "rule.1.traffic_type", "ingress"), ), }, }, @@ -86,31 +86,31 @@ func TestAccCloudStackNetworkACLRule_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_network_acl_rule.foo", "rule.#", "3"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.action", "allow"), + "cloudstack_network_acl_rule.foo", "rule.0.action", "allow"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.cidr_list.2835005819", "172.16.100.0/24"), + "cloudstack_network_acl_rule.foo", "rule.0.cidr_list.0", "172.16.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.protocol", "tcp"), + "cloudstack_network_acl_rule.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.ports.#", "2"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.ports.1889509032", "80"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.ports.3638101695", "443"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.0", "443"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2898748868.traffic_type", "ingress"), + "cloudstack_network_acl_rule.foo", "rule.0.traffic_type", "ingress"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.action", "allow"), + "cloudstack_network_acl_rule.foo", "rule.1.action", "allow"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.cidr_list.#", "1"), + "cloudstack_network_acl_rule.foo", "rule.1.cidr_list.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_network_acl_rule.foo", "rule.1.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.icmp_code", "-1"), + "cloudstack_network_acl_rule.foo", "rule.1.icmp_code", "-1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.icmp_type", "-1"), + "cloudstack_network_acl_rule.foo", "rule.1.icmp_type", "-1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1480917538.traffic_type", "ingress"), + "cloudstack_network_acl_rule.foo", "rule.1.traffic_type", "ingress"), ), }, @@ -121,47 +121,47 @@ func TestAccCloudStackNetworkACLRule_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_network_acl_rule.foo", "rule.#", "4"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.action", "deny"), + "cloudstack_network_acl_rule.foo", "rule.1.action", "deny"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.cidr_list.3482919157", "10.0.0.0/24"), + "cloudstack_network_acl_rule.foo", "rule.1.cidr_list.0", "10.0.0.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.protocol", "tcp"), + "cloudstack_network_acl_rule.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.ports.#", "2"), + "cloudstack_network_acl_rule.foo", "rule.1.ports.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.ports.1209010669", "1000-2000"), + "cloudstack_network_acl_rule.foo", "rule.1.ports.0", "1000-2000"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.ports.1889509032", "80"), + "cloudstack_network_acl_rule.foo", "rule.1.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.1724235854.traffic_type", "egress"), + "cloudstack_network_acl_rule.foo", "rule.1.traffic_type", "egress"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.action", "deny"), + "cloudstack_network_acl_rule.foo", "rule.2.action", "deny"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.cidr_list.#", "2"), + "cloudstack_network_acl_rule.foo", "rule.2.cidr_list.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.cidr_list.2104435309", "172.18.101.0/24"), + "cloudstack_network_acl_rule.foo", "rule.2.cidr_list.1", "172.18.101.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_network_acl_rule.foo", "rule.2.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.icmp_code", "-1"), + "cloudstack_network_acl_rule.foo", "rule.2.icmp_code", "-1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.icmp_type", "-1"), + "cloudstack_network_acl_rule.foo", "rule.2.icmp_type", "-1"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2090315355.traffic_type", "ingress"), + "cloudstack_network_acl_rule.foo", "rule.2.traffic_type", "ingress"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.action", "allow"), + "cloudstack_network_acl_rule.foo", "rule.0.action", "allow"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_network_acl_rule.foo", "rule.0.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.protocol", "tcp"), + "cloudstack_network_acl_rule.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.ports.#", "2"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.ports.1889509032", "80"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.ports.3638101695", "443"), + "cloudstack_network_acl_rule.foo", "rule.0.ports.0", "443"), resource.TestCheckResourceAttr( - "cloudstack_network_acl_rule.foo", "rule.2576683033.traffic_type", "ingress"), + "cloudstack_network_acl_rule.foo", "rule.0.traffic_type", "ingress"), ), }, }, @@ -238,11 +238,11 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "foo" { name = "terraform-acl" description = "terraform-acl-text" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_network_acl_rule" "foo" { - acl_id = "${cloudstack_network_acl.foo.id}" + acl_id = cloudstack_network_acl.foo.id rule { action = "allow" @@ -279,11 +279,11 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "foo" { name = "terraform-acl" description = "terraform-acl-text" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_network_acl_rule" "foo" { - acl_id = "${cloudstack_network_acl.foo.id}" + acl_id = cloudstack_network_acl.foo.id rule { action = "deny" diff --git a/cloudstack/resource_cloudstack_network_acl_test.go b/cloudstack/resource_cloudstack_network_acl_test.go index 2e534f60..b252a5a5 100644 --- a/cloudstack/resource_cloudstack_network_acl_test.go +++ b/cloudstack/resource_cloudstack_network_acl_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackNetworkACL_basic(t *testing.T) { @@ -142,5 +142,5 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "foo" { name = "terraform-acl" description = "terraform-acl-text" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id }` diff --git a/cloudstack/resource_cloudstack_network_offering.go b/cloudstack/resource_cloudstack_network_offering.go index 4f141ccf..a418b144 100644 --- a/cloudstack/resource_cloudstack_network_offering.go +++ b/cloudstack/resource_cloudstack_network_offering.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackNetworkOffering() *schema.Resource { @@ -84,7 +84,6 @@ func resourceCloudStackNetworkOfferingCreate(d *schema.ResourceData, meta interf func resourceCloudStackNetworkOfferingUpdate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) name := d.Get("name").(string) @@ -105,7 +104,6 @@ func resourceCloudStackNetworkOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the name for network offering %s: %s", name, err) } - d.SetPartial("name") } // Check if the display text is changed and if so, update the virtual machine @@ -125,7 +123,6 @@ func resourceCloudStackNetworkOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the display text for network offering %s: %s", name, err) } - d.SetPartial("display_text") } // Check if the guest ip type is changed and if so, update the virtual machine @@ -145,7 +142,6 @@ func resourceCloudStackNetworkOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the guest ip type for network offering %s: %s", name, err) } - d.SetPartial("guest_ip_type") } // Check if the traffic type is changed and if so, update the virtual machine @@ -165,11 +161,8 @@ func resourceCloudStackNetworkOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the traffic type for network offering %s: %s", name, err) } - d.SetPartial("traffic_type") } - d.Partial(false) - return resourceCloudStackInstanceRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_network_test.go b/cloudstack/resource_cloudstack_network_test.go index e389dbdd..0b650ace 100644 --- a/cloudstack/resource_cloudstack_network_test.go +++ b/cloudstack/resource_cloudstack_network_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackNetwork_basic(t *testing.T) { @@ -106,7 +106,6 @@ func TestAccCloudStackNetwork_updateACL(t *testing.T) { testAccCheckCloudStackNetworkVPCAttributes(&network), ), }, - { Config: testAccCloudStackNetwork_updateACL, Check: resource.ComposeTestCheckFunc( @@ -115,6 +114,14 @@ func TestAccCloudStackNetwork_updateACL(t *testing.T) { testAccCheckCloudStackNetworkVPCAttributes(&network), ), }, + { + Config: testAccCloudStackNetwork_updateACL_cleanup, + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudStackNetworkExists( + "cloudstack_network.foo", &network), + testAccCheckCloudStackNetworkVPCAttributes(&network), + ), + }, }, }) } @@ -261,6 +268,7 @@ func testAccCheckCloudStackNetworkDestroy(s *terraform.State) error { const testAccCloudStackNetwork_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -272,6 +280,7 @@ resource "cloudstack_network" "foo" { const testAccCloudStackNetwork_project = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" project = "terraform" @@ -288,10 +297,11 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" - vpc_id = "${cloudstack_vpc.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + zone = cloudstack_vpc.foo.zone }` const testAccCloudStackNetwork_acl = ` @@ -304,16 +314,17 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "foo" { name = "foo" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" - vpc_id = "${cloudstack_vpc.foo.id}" - acl_id = "${cloudstack_network_acl.foo.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + acl_id = cloudstack_network_acl.foo.id + zone = cloudstack_vpc.foo.zone }` const testAccCloudStackNetwork_updateACL = ` @@ -326,14 +337,43 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "bar" { name = "bar" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id +} + +resource "cloudstack_network_acl" "foo" { + name = "foo" + vpc_id = cloudstack_vpc.foo.id +} + +resource "cloudstack_network" "foo" { + name = "terraform-network" + display_text = "terraform-network" + cidr = "10.1.1.0/24" + network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" + vpc_id = cloudstack_vpc.foo.id + acl_id = cloudstack_network_acl.bar.id + zone = cloudstack_vpc.foo.zone +}` + +const testAccCloudStackNetwork_updateACL_cleanup = ` +resource "cloudstack_vpc" "foo" { + name = "terraform-vpc" + cidr = "10.0.0.0/8" + vpc_offering = "Default VPC offering" + zone = "Sandbox-simulator" +} + +resource "cloudstack_network_acl" "bar" { + name = "bar" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" - vpc_id = "${cloudstack_vpc.foo.id}" - acl_id = "${cloudstack_network_acl.bar.id}" - zone = "${cloudstack_vpc.foo.zone}" + vpc_id = cloudstack_vpc.foo.id + acl_id = cloudstack_network_acl.bar.id + zone = cloudstack_vpc.foo.zone }` diff --git a/cloudstack/resource_cloudstack_nic.go b/cloudstack/resource_cloudstack_nic.go index cc75840e..82f455ee 100644 --- a/cloudstack/resource_cloudstack_nic.go +++ b/cloudstack/resource_cloudstack_nic.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackNIC() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_nic_test.go b/cloudstack/resource_cloudstack_nic_test.go index d5122e0f..7b666752 100644 --- a/cloudstack/resource_cloudstack_nic_test.go +++ b/cloudstack/resource_cloudstack_nic_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackNIC_basic(t *testing.T) { @@ -171,6 +171,7 @@ func testAccCheckCloudStackNICDestroy(s *terraform.State) error { const testAccCloudStackNIC_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -178,6 +179,7 @@ resource "cloudstack_network" "foo" { resource "cloudstack_network" "bar" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.2.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -187,20 +189,21 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" expunge = true } resource "cloudstack_nic" "foo" { - network_id = "${cloudstack_network.bar.id}" - virtual_machine_id = "${cloudstack_instance.foobar.id}" + network_id = cloudstack_network.bar.id + virtual_machine_id = cloudstack_instance.foobar.id }` const testAccCloudStackNIC_ipaddress = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -208,6 +211,7 @@ resource "cloudstack_network" "foo" { resource "cloudstack_network" "bar" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.2.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -217,14 +221,14 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" expunge = true } resource "cloudstack_nic" "foo" { - network_id = "${cloudstack_network.bar.id}" - virtual_machine_id = "${cloudstack_instance.foobar.id}" + network_id = cloudstack_network.bar.id + virtual_machine_id = cloudstack_instance.foobar.id ip_address = "10.1.2.123" }` diff --git a/cloudstack/resource_cloudstack_port_forward.go b/cloudstack/resource_cloudstack_port_forward.go index 0ada0f32..cd934318 100644 --- a/cloudstack/resource_cloudstack_port_forward.go +++ b/cloudstack/resource_cloudstack_port_forward.go @@ -29,7 +29,7 @@ import ( "github.com/apache/cloudstack-go/v2/cloudstack" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackPortForward() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_port_forward_test.go b/cloudstack/resource_cloudstack_port_forward_test.go index 0333ed18..3f9e5e37 100644 --- a/cloudstack/resource_cloudstack_port_forward_test.go +++ b/cloudstack/resource_cloudstack_port_forward_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackPortForward_basic(t *testing.T) { @@ -136,9 +136,10 @@ func testAccCheckCloudStackPortForwardDestroy(s *terraform.State) error { const testAccCloudStackPortForward_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" - source_nat_ip = true + source_nat_ip = true zone = "Sandbox-simulator" } @@ -146,29 +147,30 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-updated" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" expunge = true } resource "cloudstack_port_forward" "foo" { - ip_address_id = "${cloudstack_network.foo.source_nat_ip_id}" + ip_address_id = cloudstack_network.foo.source_nat_ip_id forward { protocol = "tcp" private_port = 443 public_port = 8443 - virtual_machine_id = "${cloudstack_instance.foobar.id}" + virtual_machine_id = cloudstack_instance.foobar.id } }` const testAccCloudStackPortForward_update = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" - source_nat_ip = true + source_nat_ip = true zone = "Sandbox-simulator" } @@ -176,26 +178,26 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform-updated" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" expunge = true } resource "cloudstack_port_forward" "foo" { - ip_address_id = "${cloudstack_network.foo.source_nat_ip_id}" + ip_address_id = cloudstack_network.foo.source_nat_ip_id forward { protocol = "tcp" private_port = 443 public_port = 8443 - virtual_machine_id = "${cloudstack_instance.foobar.id}" + virtual_machine_id = cloudstack_instance.foobar.id } forward { protocol = "tcp" private_port = 80 public_port = 8080 - virtual_machine_id = "${cloudstack_instance.foobar.id}" + virtual_machine_id = cloudstack_instance.foobar.id } }` diff --git a/cloudstack/resource_cloudstack_private_gateway.go b/cloudstack/resource_cloudstack_private_gateway.go index c4b6c82a..6d4e0078 100644 --- a/cloudstack/resource_cloudstack_private_gateway.go +++ b/cloudstack/resource_cloudstack_private_gateway.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackPrivateGateway() *schema.Resource { @@ -100,9 +100,9 @@ func resourceCloudStackPrivateGatewayCreate(d *schema.ResourceData, meta interfa d.Get("gateway").(string), ipaddress, d.Get("netmask").(string), - d.Get("vlan").(string), d.Get("vpc_id").(string), ) + p.SetVlan(d.Get("vlan").(string)) // Retrieve the network_offering ID if networkofferingid != "" { diff --git a/cloudstack/resource_cloudstack_private_gateway_test.go b/cloudstack/resource_cloudstack_private_gateway_test.go index 66af8c39..a20a8141 100644 --- a/cloudstack/resource_cloudstack_private_gateway_test.go +++ b/cloudstack/resource_cloudstack_private_gateway_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackPrivateGateway_basic(t *testing.T) { @@ -147,7 +147,7 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "foo" { name = "terraform-acl" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id depends_on = ["cloudstack_vpc.foo"] } @@ -156,7 +156,7 @@ resource "cloudstack_private_gateway" "foo" { ip_address = "192.168.0.1" netmask = "255.255.255.0" vlan = "1" - vpc_id = "${cloudstack_vpc.foo.id}" - acl_id = "${cloudstack_network_acl.foo.id}" + vpc_id = cloudstack_vpc.foo.id + acl_id = cloudstack_network_acl.foo.id depends_on = ["cloudstack_vpc.foo","cloudstack_network_acl.foo"] }` diff --git a/cloudstack/resource_cloudstack_secondary_ipaddress.go b/cloudstack/resource_cloudstack_secondary_ipaddress.go index 4f8c6dec..db65f6ef 100644 --- a/cloudstack/resource_cloudstack_secondary_ipaddress.go +++ b/cloudstack/resource_cloudstack_secondary_ipaddress.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackSecondaryIPAddress() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_secondary_ipaddress_test.go b/cloudstack/resource_cloudstack_secondary_ipaddress_test.go index 1daf054b..a991e004 100644 --- a/cloudstack/resource_cloudstack_secondary_ipaddress_test.go +++ b/cloudstack/resource_cloudstack_secondary_ipaddress_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackSecondaryIPAddress_basic(t *testing.T) { @@ -221,6 +221,7 @@ func testAccCheckCloudStackSecondaryIPAddressDestroy(s *terraform.State) error { const testAccCloudStackSecondaryIPAddress_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -229,19 +230,20 @@ resource "cloudstack_network" "foo" { resource "cloudstack_instance" "foobar" { name = "terraform-test" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" expunge = true } resource "cloudstack_secondary_ipaddress" "foo" { - virtual_machine_id = "${cloudstack_instance.foobar.id}" -} ` + virtual_machine_id = cloudstack_instance.foobar.id +}` const testAccCloudStackSecondaryIPAddress_fixedIP = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" zone = "Sandbox-simulator" @@ -250,7 +252,7 @@ resource "cloudstack_network" "foo" { resource "cloudstack_instance" "foobar" { name = "terraform-test" service_offering= "Medium Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" zone = "Sandbox-simulator" expunge = true @@ -258,5 +260,5 @@ resource "cloudstack_instance" "foobar" { resource "cloudstack_secondary_ipaddress" "foo" { ip_address = "10.1.1.123" - virtual_machine_id = "${cloudstack_instance.foobar.id}" + virtual_machine_id = cloudstack_instance.foobar.id }` diff --git a/cloudstack/resource_cloudstack_security_group.go b/cloudstack/resource_cloudstack_security_group.go index c2d2f10f..a4ecbcdc 100644 --- a/cloudstack/resource_cloudstack_security_group.go +++ b/cloudstack/resource_cloudstack_security_group.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackSecurityGroup() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_security_group_rule.go b/cloudstack/resource_cloudstack_security_group_rule.go index 9b81e05b..a1b21dd6 100644 --- a/cloudstack/resource_cloudstack_security_group_rule.go +++ b/cloudstack/resource_cloudstack_security_group_rule.go @@ -29,7 +29,7 @@ import ( "github.com/apache/cloudstack-go/v2/cloudstack" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) type authorizeSecurityGroupParams interface { diff --git a/cloudstack/resource_cloudstack_security_group_rule_test.go b/cloudstack/resource_cloudstack_security_group_rule_test.go index 768c89f1..804a4a80 100644 --- a/cloudstack/resource_cloudstack_security_group_rule_test.go +++ b/cloudstack/resource_cloudstack_security_group_rule_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackSecurityGroupRule_basic(t *testing.T) { @@ -42,25 +42,25 @@ func TestAccCloudStackSecurityGroupRule_basic(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_security_group_rule.foo", "rule.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_security_group_rule.foo", "rule.0.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.protocol", "tcp"), + "cloudstack_security_group_rule.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.ports.#", "1"), + "cloudstack_security_group_rule.foo", "rule.0.ports.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.ports.1889509032", "80"), + "cloudstack_security_group_rule.foo", "rule.0.ports.0", "80"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.traffic_type", "ingress"), + "cloudstack_security_group_rule.foo", "rule.0.traffic_type", "ingress"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.protocol", "tcp"), + "cloudstack_security_group_rule.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.ports.1889509032", "80"), + "cloudstack_security_group_rule.foo", "rule.1.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.ports.3638101695", "443"), + "cloudstack_security_group_rule.foo", "rule.1.ports.0", "443"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.traffic_type", "egress"), + "cloudstack_security_group_rule.foo", "rule.1.traffic_type", "egress"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.user_security_group_list.1089118859", "terraform-security-group-bar"), + "cloudstack_security_group_rule.foo", "rule.1.user_security_group_list.0", "terraform-security-group-bar"), ), }, }, @@ -80,25 +80,25 @@ func TestAccCloudStackSecurityGroupRule_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_security_group_rule.foo", "rule.#", "2"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_security_group_rule.foo", "rule.0.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.protocol", "tcp"), + "cloudstack_security_group_rule.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.ports.#", "1"), + "cloudstack_security_group_rule.foo", "rule.0.ports.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.ports.1889509032", "80"), + "cloudstack_security_group_rule.foo", "rule.0.ports.0", "80"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1322309156.traffic_type", "ingress"), + "cloudstack_security_group_rule.foo", "rule.0.traffic_type", "ingress"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.protocol", "tcp"), + "cloudstack_security_group_rule.foo", "rule.1.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.ports.1889509032", "80"), + "cloudstack_security_group_rule.foo", "rule.1.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.ports.3638101695", "443"), + "cloudstack_security_group_rule.foo", "rule.1.ports.0", "443"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.traffic_type", "egress"), + "cloudstack_security_group_rule.foo", "rule.1.traffic_type", "egress"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3666289950.user_security_group_list.1089118859", "terraform-security-group-bar"), + "cloudstack_security_group_rule.foo", "rule.1.user_security_group_list.0", "terraform-security-group-bar"), ), }, @@ -109,33 +109,33 @@ func TestAccCloudStackSecurityGroupRule_update(t *testing.T) { resource.TestCheckResourceAttr( "cloudstack_security_group_rule.foo", "rule.#", "3"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3156342770.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_security_group_rule.foo", "rule.0.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3156342770.cidr_list.951907883", "172.18.200.0/24"), + "cloudstack_security_group_rule.foo", "rule.0.cidr_list.1", "172.18.200.0/24"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3156342770.protocol", "tcp"), + "cloudstack_security_group_rule.foo", "rule.0.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3156342770.ports.1889509032", "80"), + "cloudstack_security_group_rule.foo", "rule.0.ports.1", "80"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3156342770.ports.3638101695", "443"), + "cloudstack_security_group_rule.foo", "rule.0.ports.0", "443"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3839437815.cidr_list.#", "1"), + "cloudstack_security_group_rule.foo", "rule.1.cidr_list.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3839437815.cidr_list.3056857544", "172.18.100.0/24"), + "cloudstack_security_group_rule.foo", "rule.1.cidr_list.0", "172.18.100.0/24"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3839437815.icmp_code", "-1"), + "cloudstack_security_group_rule.foo", "rule.1.icmp_code", "-1"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.3839437815.icmp_type", "-1"), + "cloudstack_security_group_rule.foo", "rule.1.icmp_type", "-1"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1804489748.protocol", "tcp"), + "cloudstack_security_group_rule.foo", "rule.2.protocol", "tcp"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1804489748.ports.#", "1"), + "cloudstack_security_group_rule.foo", "rule.2.ports.#", "1"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1804489748.ports.1889509032", "80"), + "cloudstack_security_group_rule.foo", "rule.2.ports.0", "80"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1804489748.traffic_type", "egress"), + "cloudstack_security_group_rule.foo", "rule.2.traffic_type", "egress"), resource.TestCheckResourceAttr( - "cloudstack_security_group_rule.foo", "rule.1804489748.user_security_group_list.1089118859", "terraform-security-group-bar"), + "cloudstack_security_group_rule.foo", "rule.2.user_security_group_list.0", "terraform-security-group-bar"), ), }, }, @@ -236,7 +236,7 @@ resource "cloudstack_security_group" "bar" { } resource "cloudstack_security_group_rule" "foo" { - security_group_id = "${cloudstack_security_group.foo.id}" + security_group_id = cloudstack_security_group.foo.id rule { cidr_list = ["172.18.100.0/24"] @@ -266,7 +266,7 @@ resource "cloudstack_security_group" "bar" { } resource "cloudstack_security_group_rule" "foo" { - security_group_id = "${cloudstack_security_group.foo.id}" + security_group_id = cloudstack_security_group.foo.id rule { cidr_list = ["172.18.100.0/24", "172.18.200.0/24"] diff --git a/cloudstack/resource_cloudstack_security_group_test.go b/cloudstack/resource_cloudstack_security_group_test.go index 174bea4c..b75776ca 100644 --- a/cloudstack/resource_cloudstack_security_group_test.go +++ b/cloudstack/resource_cloudstack_security_group_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackSecurityGroup_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_service_offering.go b/cloudstack/resource_cloudstack_service_offering.go index 25dad334..170e05e0 100644 --- a/cloudstack/resource_cloudstack_service_offering.go +++ b/cloudstack/resource_cloudstack_service_offering.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackServiceOffering() *schema.Resource { @@ -188,7 +188,6 @@ func resourceCloudStackServiceOfferingRead(d *schema.ResourceData, meta interfac func resourceCloudStackServiceOfferingUpdate(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) - d.Partial(true) name := d.Get("name").(string) @@ -209,7 +208,6 @@ func resourceCloudStackServiceOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the name for service offering %s: %s", name, err) } - d.SetPartial("name") } // Check if the display text is changed and if so, update seervice offering @@ -229,7 +227,6 @@ func resourceCloudStackServiceOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the display text for service offering %s: %s", name, err) } - d.SetPartial("display_text") } if d.HasChange("host_tags") { @@ -248,11 +245,8 @@ func resourceCloudStackServiceOfferingUpdate(d *schema.ResourceData, meta interf "Error updating the host tags for service offering %s: %s", name, err) } - d.SetPartial("host_tags") } - d.Partial(false) - return resourceCloudStackServiceOfferingRead(d, meta) } diff --git a/cloudstack/resource_cloudstack_service_offering_test.go b/cloudstack/resource_cloudstack_service_offering_test.go index 1e1d6ccf..fc29628c 100644 --- a/cloudstack/resource_cloudstack_service_offering_test.go +++ b/cloudstack/resource_cloudstack_service_offering_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackServiceOffering_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_ssh_keypair.go b/cloudstack/resource_cloudstack_ssh_keypair.go index 2ed8f680..cf44677d 100644 --- a/cloudstack/resource_cloudstack_ssh_keypair.go +++ b/cloudstack/resource_cloudstack_ssh_keypair.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackSSHKeyPair() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_ssh_keypair_test.go b/cloudstack/resource_cloudstack_ssh_keypair_test.go index 44ef1d02..7e7b25dd 100644 --- a/cloudstack/resource_cloudstack_ssh_keypair_test.go +++ b/cloudstack/resource_cloudstack_ssh_keypair_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackSSHKeyPair_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_static_nat.go b/cloudstack/resource_cloudstack_static_nat.go index c3dbd226..2b2c4027 100644 --- a/cloudstack/resource_cloudstack_static_nat.go +++ b/cloudstack/resource_cloudstack_static_nat.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackStaticNAT() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_static_nat_test.go b/cloudstack/resource_cloudstack_static_nat_test.go index 39d6cde2..eebebcb0 100644 --- a/cloudstack/resource_cloudstack_static_nat_test.go +++ b/cloudstack/resource_cloudstack_static_nat_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackStaticNAT_basic(t *testing.T) { @@ -117,9 +117,10 @@ func testAccCheckCloudStackStaticNATDestroy(s *terraform.State) error { const testAccCloudStackStaticNAT_basic = ` resource "cloudstack_network" "foo" { name = "terraform-network" + display_text = "terraform-network" cidr = "10.1.1.0/24" network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" - source_nat_ip = true + source_nat_ip = true zone = "Sandbox-simulator" } @@ -127,17 +128,17 @@ resource "cloudstack_instance" "foobar" { name = "terraform-test" display_name = "terraform" service_offering= "Small Instance" - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id template = "CentOS 5.6 (64-bit) no GUI (Simulator)" - zone = "${cloudstack_network.foo.zone}" + zone = cloudstack_network.foo.zone expunge = true } resource "cloudstack_ipaddress" "foo" { - network_id = "${cloudstack_network.foo.id}" + network_id = cloudstack_network.foo.id } resource "cloudstack_static_nat" "foo" { - ip_address_id = "${cloudstack_ipaddress.foo.id}" - virtual_machine_id = "${cloudstack_instance.foobar.id}" + ip_address_id = cloudstack_ipaddress.foo.id + virtual_machine_id = cloudstack_instance.foobar.id }` diff --git a/cloudstack/resource_cloudstack_static_route.go b/cloudstack/resource_cloudstack_static_route.go index ddcdc472..09705324 100644 --- a/cloudstack/resource_cloudstack_static_route.go +++ b/cloudstack/resource_cloudstack_static_route.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackStaticRoute() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_static_route_test.go b/cloudstack/resource_cloudstack_static_route_test.go index c9f321c4..dcf754d1 100644 --- a/cloudstack/resource_cloudstack_static_route_test.go +++ b/cloudstack/resource_cloudstack_static_route_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackStaticRoute_basic(t *testing.T) { @@ -120,7 +120,7 @@ resource "cloudstack_vpc" "foo" { resource "cloudstack_network_acl" "foo" { name = "terraform-acl" - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_private_gateway" "foo" { @@ -128,11 +128,11 @@ resource "cloudstack_private_gateway" "foo" { ip_address = "192.168.0.1" netmask = "255.255.255.0" vlan = "1" - vpc_id = "${cloudstack_vpc.foo.id}" - acl_id = "${cloudstack_network_acl.foo.id}" + vpc_id = cloudstack_vpc.foo.id + acl_id = cloudstack_network_acl.foo.id } resource "cloudstack_static_route" "foo" { cidr = "172.16.0.0/16" - gateway_id = "${cloudstack_private_gateway.foo.id}" + gateway_id = cloudstack_private_gateway.foo.id }` diff --git a/cloudstack/resource_cloudstack_template.go b/cloudstack/resource_cloudstack_template.go index c1a4f877..edf41c12 100644 --- a/cloudstack/resource_cloudstack_template.go +++ b/cloudstack/resource_cloudstack_template.go @@ -26,7 +26,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackTemplate() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_template_test.go b/cloudstack/resource_cloudstack_template_test.go index da185520..510906a3 100644 --- a/cloudstack/resource_cloudstack_template_test.go +++ b/cloudstack/resource_cloudstack_template_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackTemplate_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_user.go b/cloudstack/resource_cloudstack_user.go index aabb7b20..74fb84a9 100644 --- a/cloudstack/resource_cloudstack_user.go +++ b/cloudstack/resource_cloudstack_user.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackUser() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_volume.go b/cloudstack/resource_cloudstack_volume.go index a2fb725d..2f1a88f1 100644 --- a/cloudstack/resource_cloudstack_volume.go +++ b/cloudstack/resource_cloudstack_volume.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackVolume() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_vpc.go b/cloudstack/resource_cloudstack_vpc.go index d5710119..b8cf46f2 100644 --- a/cloudstack/resource_cloudstack_vpc.go +++ b/cloudstack/resource_cloudstack_vpc.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackVPC() *schema.Resource { @@ -264,7 +264,6 @@ func resourceCloudStackVPCUpdate(d *schema.ResourceData, meta interface{}) error if err != nil { return fmt.Errorf("Error updating tags on VPC %s: %s", name, err) } - d.SetPartial("tags") } return resourceCloudStackVPCRead(d, meta) diff --git a/cloudstack/resource_cloudstack_vpc_test.go b/cloudstack/resource_cloudstack_vpc_test.go index 8516f221..73218fea 100644 --- a/cloudstack/resource_cloudstack_vpc_test.go +++ b/cloudstack/resource_cloudstack_vpc_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackVPC_basic(t *testing.T) { diff --git a/cloudstack/resource_cloudstack_vpn_connection.go b/cloudstack/resource_cloudstack_vpn_connection.go index 5beadb6c..a493e16d 100644 --- a/cloudstack/resource_cloudstack_vpn_connection.go +++ b/cloudstack/resource_cloudstack_vpn_connection.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackVPNConnection() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_vpn_connection_test.go b/cloudstack/resource_cloudstack_vpn_connection_test.go index 064233bd..55d42a75 100644 --- a/cloudstack/resource_cloudstack_vpn_connection_test.go +++ b/cloudstack/resource_cloudstack_vpn_connection_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackVPNConnection_basic(t *testing.T) { @@ -115,37 +115,37 @@ resource "cloudstack_vpc" "bar" { } resource "cloudstack_vpn_gateway" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_vpn_gateway" "bar" { - vpc_id = "${cloudstack_vpc.bar.id}" + vpc_id = cloudstack_vpc.bar.id } resource "cloudstack_vpn_customer_gateway" "foo" { name = "terraform-foo" - cidr = "${cloudstack_vpc.foo.cidr}" + cidr = cloudstack_vpc.foo.cidr esp_policy = "aes256-sha1" - gateway = "${cloudstack_vpn_gateway.foo.public_ip}" + gateway = cloudstack_vpn_gateway.foo.public_ip ike_policy = "aes256-sha1;modp1536" ipsec_psk = "terraform" } resource "cloudstack_vpn_customer_gateway" "bar" { name = "terraform-bar" - cidr = "${cloudstack_vpc.bar.cidr}" + cidr = cloudstack_vpc.bar.cidr esp_policy = "aes256-sha1" - gateway = "${cloudstack_vpn_gateway.bar.public_ip}" + gateway = cloudstack_vpn_gateway.bar.public_ip ike_policy = "aes256-sha1;modp1536" ipsec_psk = "terraform" } resource "cloudstack_vpn_connection" "foo-bar" { - customer_gateway_id = "${cloudstack_vpn_customer_gateway.foo.id}" - vpn_gateway_id = "${cloudstack_vpn_gateway.bar.id}" + customer_gateway_id = cloudstack_vpn_customer_gateway.foo.id + vpn_gateway_id = cloudstack_vpn_gateway.bar.id } resource "cloudstack_vpn_connection" "bar-foo" { - customer_gateway_id = "${cloudstack_vpn_customer_gateway.bar.id}" - vpn_gateway_id = "${cloudstack_vpn_gateway.foo.id}" + customer_gateway_id = cloudstack_vpn_customer_gateway.bar.id + vpn_gateway_id = cloudstack_vpn_gateway.foo.id }` diff --git a/cloudstack/resource_cloudstack_vpn_customer_gateway.go b/cloudstack/resource_cloudstack_vpn_customer_gateway.go index fb59ddbe..c1f67380 100644 --- a/cloudstack/resource_cloudstack_vpn_customer_gateway.go +++ b/cloudstack/resource_cloudstack_vpn_customer_gateway.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackVPNCustomerGateway() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_vpn_customer_gateway_test.go b/cloudstack/resource_cloudstack_vpn_customer_gateway_test.go index 5fada1c4..8df06662 100644 --- a/cloudstack/resource_cloudstack_vpn_customer_gateway_test.go +++ b/cloudstack/resource_cloudstack_vpn_customer_gateway_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackVPNCustomerGateway_basic(t *testing.T) { @@ -226,27 +226,27 @@ resource "cloudstack_vpc" "bar" { } resource "cloudstack_vpn_gateway" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_vpn_gateway" "bar" { - vpc_id = "${cloudstack_vpc.bar.id}" + vpc_id = cloudstack_vpc.bar.id } resource "cloudstack_vpn_customer_gateway" "foo" { name = "terraform-foo" - cidr = "${cloudstack_vpc.foo.cidr}" + cidr = cloudstack_vpc.foo.cidr esp_policy = "aes256-sha1" - gateway = "${cloudstack_vpn_gateway.foo.public_ip}" + gateway = cloudstack_vpn_gateway.foo.public_ip ike_policy = "aes256-sha1;modp1536" ipsec_psk = "terraform" } resource "cloudstack_vpn_customer_gateway" "bar" { name = "terraform-bar" - cidr = "${cloudstack_vpc.bar.cidr}" + cidr = cloudstack_vpc.bar.cidr esp_policy = "aes256-sha1" - gateway = "${cloudstack_vpn_gateway.bar.public_ip}" + gateway = cloudstack_vpn_gateway.bar.public_ip ike_policy = "aes256-sha1;modp1536" ipsec_psk = "terraform" }` @@ -267,27 +267,27 @@ resource "cloudstack_vpc" "bar" { } resource "cloudstack_vpn_gateway" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id } resource "cloudstack_vpn_gateway" "bar" { - vpc_id = "${cloudstack_vpc.bar.id}" + vpc_id = cloudstack_vpc.bar.id } resource "cloudstack_vpn_customer_gateway" "foo" { name = "terraform-foo-bar" - cidr = "${cloudstack_vpc.foo.cidr}" + cidr = cloudstack_vpc.foo.cidr esp_policy = "3des-md5" - gateway = "${cloudstack_vpn_gateway.foo.public_ip}" + gateway = cloudstack_vpn_gateway.foo.public_ip ike_policy = "3des-md5;modp1536" ipsec_psk = "terraform" } resource "cloudstack_vpn_customer_gateway" "bar" { name = "terraform-bar-foo" - cidr = "${cloudstack_vpc.bar.cidr}" + cidr = cloudstack_vpc.bar.cidr esp_policy = "3des-md5" - gateway = "${cloudstack_vpn_gateway.bar.public_ip}" + gateway = cloudstack_vpn_gateway.bar.public_ip ike_policy = "3des-md5;modp1536" ipsec_psk = "terraform" }` diff --git a/cloudstack/resource_cloudstack_vpn_gateway.go b/cloudstack/resource_cloudstack_vpn_gateway.go index 7fe8443a..e35565ec 100644 --- a/cloudstack/resource_cloudstack_vpn_gateway.go +++ b/cloudstack/resource_cloudstack_vpn_gateway.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackVPNGateway() *schema.Resource { diff --git a/cloudstack/resource_cloudstack_vpn_gateway_test.go b/cloudstack/resource_cloudstack_vpn_gateway_test.go index ed39ae30..4c88156e 100644 --- a/cloudstack/resource_cloudstack_vpn_gateway_test.go +++ b/cloudstack/resource_cloudstack_vpn_gateway_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudStackVPNGateway_basic(t *testing.T) { @@ -125,5 +125,5 @@ resource "cloudstack_vpc" "foo" { } resource "cloudstack_vpn_gateway" "foo" { - vpc_id = "${cloudstack_vpc.foo.id}" + vpc_id = cloudstack_vpc.foo.id }` diff --git a/cloudstack/resource_cloudstack_zone.go b/cloudstack/resource_cloudstack_zone.go index a259f656..d7433df9 100644 --- a/cloudstack/resource_cloudstack_zone.go +++ b/cloudstack/resource_cloudstack_zone.go @@ -24,7 +24,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func resourceCloudStackZone() *schema.Resource { diff --git a/cloudstack/resources.go b/cloudstack/resources.go index 1b299589..0fedb70c 100644 --- a/cloudstack/resources.go +++ b/cloudstack/resources.go @@ -27,7 +27,7 @@ import ( "time" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) // Define a regexp for parsing the port diff --git a/cloudstack/tags.go b/cloudstack/tags.go index 3aa38e1a..4f519fdc 100644 --- a/cloudstack/tags.go +++ b/cloudstack/tags.go @@ -23,7 +23,7 @@ import ( "log" "github.com/apache/cloudstack-go/v2/cloudstack" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) // tagsSchema returns the schema to use for tags @@ -111,3 +111,11 @@ func tagsFromSchema(m map[string]interface{}) map[string]string { } return result } + +func tagsToMap(tags []cloudstack.Tags) map[string]string { + result := make(map[string]string, len(tags)) + for _, tag := range tags { + result[tag.Key] = tag.Value + } + return result +} diff --git a/cloudstack/tags_test.go b/cloudstack/tags_test.go index 3bdfb724..e19cd044 100644 --- a/cloudstack/tags_test.go +++ b/cloudstack/tags_test.go @@ -25,8 +25,8 @@ import ( "reflect" "testing" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestDiffTags(t *testing.T) { diff --git a/go.mod b/go.mod index 59cdcb3e..01b48a33 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,69 @@ module github.com/terraform-providers/terraform-provider-cloudstack require ( - github.com/apache/cloudstack-go/v2 v2.13.2 + github.com/apache/cloudstack-go/v2 v2.16.0 github.com/go-ini/ini v1.67.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/terraform v0.12.0 - golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect - golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef // indirect + github.com/hashicorp/terraform-plugin-go v0.22.0 + github.com/hashicorp/terraform-plugin-mux v0.15.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 + github.com/hashicorp/terraform-plugin-testing v1.7.0 ) -go 1.16 +require ( + github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect + github.com/agext/levenshtein v1.2.2 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect + github.com/hashicorp/go-hclog v1.6.2 // indirect + github.com/hashicorp/go-plugin v1.6.0 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/hc-install v0.6.3 // indirect + github.com/hashicorp/hcl/v2 v2.20.0 // indirect + github.com/hashicorp/logutils v1.0.0 // indirect + github.com/hashicorp/terraform-exec v0.20.0 // indirect + github.com/hashicorp/terraform-json v0.21.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.3 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // 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/rogpeppe/go-internal v1.11.0 // indirect + github.com/stretchr/testify v1.8.4 // indirect + github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty v1.14.3 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.13.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/grpc v1.62.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect +) + +go 1.21 + +toolchain go1.21.6 diff --git a/go.sum b/go.sum index 866938d5..05e3e588 100644 --- a/go.sum +++ b/go.sum @@ -1,432 +1,240 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.36.0 h1:+aCSj7tOo2LODWVEuZDZeGCckdt6MlSF+X/rB3wUiS8= -cloud.google.com/go v0.36.0/go.mod h1:RUoy9p/M4ge0HzT8L+SDZ8jg+Q6fth0CiBuhFJpSV40= -dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= -dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= -dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= -dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/Azure/azure-sdk-for-go v21.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest v10.15.4+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= -github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= 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/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= -github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= -github.com/apache/cloudstack-go/v2 v2.13.2 h1:Y06CXNle++Gs24YjeNI7Ot8ZUQjLix2oPn/CMuVr/TU= -github.com/apache/cloudstack-go/v2 v2.13.2/go.mod h1:aosD8Svfu5nhH5Sp4zcsVV1hT5UGt3mTgRXM8YqTKe0= -github.com/apparentlymart/go-cidr v1.0.0 h1:lGDvXx8Lv9QHjrAVP7jyzleG4F9+FkRhJcEsDFxeb8w= -github.com/apparentlymart/go-cidr v1.0.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.16.36/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.19.18 h1:Hb3+b9HCqrOrbAtFstUWg7H5TQ+/EcklJtE8VShVs8o= -github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20161106042343-c914be64f07d/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/apache/cloudstack-go/v2 v2.16.0 h1:qK4/mtgmhzFU99WHAHM/1FhAM3cWV8gplOAGODwHyPM= +github.com/apache/cloudstack-go/v2 v2.16.0/go.mod h1:EPMwvwKMvmIFajmDCqSR747l/439DuKvKY8jbFOE/qE= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dimchansky/utfbom v1.0.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= -github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= +github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= -github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= 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.0 h1:kbxbvI4Un1LUWKxufD+BiE6AEExYYgkQLQmLFqA1LFk= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.3 h1:siORttZ36U2R/WjiJuDz8znElWBiAlO9rVt+mqJt0Cc= -github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= -github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.5.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/hashicorp/aws-sdk-go-base v0.2.0/go.mod h1:ZIWACGGi0N7a4DZbf15yuE1JQORmWLtBcVM6F5SXNFU= -github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= -github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/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-azure-helpers v0.0.0-20190129193224-166dfd221bb2/go.mod h1:lu62V//auUow6k0IykxLK2DCNW8qTmpm8KqhYVWattA= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= -github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-getter v1.3.0 h1:pFMSFlI9l5NaeuzkpE3L7BYk9qQ9juTAgXW/H0cqxcU= -github.com/hashicorp/go-getter v1.3.0/go.mod h1:/O1k/AizTN0QmfEKknCYGvICeyKUDqCYA8vvWtGWDeQ= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f h1:Yv9YzBlAETjy6AOX9eLBZ3nshNVRREgerT/3nvxlGho= -github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= -github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +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.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/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.0.1-0.20190430211030-5692942914bb h1:Zg2pmmk0lrLFL85lQGt08bOUBpIBaVs6/psiAyx0c4w= -github.com/hashicorp/go-plugin v1.0.1-0.20190430211030-5692942914bb/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-slug v0.3.0/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= -github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-tfe v0.3.16/go.mod h1:SuPHR+OcxvzBZNye7nGPfwZTEyd3rWPfLVbCgyZPezM= +github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= +github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200/go.mod h1:ShfpTh661oAaxo7VcNxg0zcZW6jvMa7Moy2oFx7e5dE= -github.com/hashicorp/hcl2 v0.0.0-20190515223218-4b22149b7cef h1:xZRvbcwHY8zhaxDwgkmpAp2emwZkVn7p3gat0zhq2X0= -github.com/hashicorp/hcl2 v0.0.0-20190515223218-4b22149b7cef/go.mod h1:4oI94iqF3GB10QScn46WqbG0kgTUpha97SAzzg2+2ec= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= +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.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hc-install v0.6.3 h1:yE/r1yJvWbtrJ0STwScgEnCanb0U9v7zp0Gbkmcoxqs= +github.com/hashicorp/hc-install v0.6.3/go.mod h1:KamGdbodYzlufbWh4r9NRo8y6GLHWZP2GBtdnms1Ln0= +github.com/hashicorp/hcl/v2 v2.20.0 h1:l++cRs/5jQOiKVvqXZm/P1ZEfVXJmvLS9WSVxkaeTb4= +github.com/hashicorp/hcl/v2 v2.20.0/go.mod h1:WmcD/Ym72MDOOx5F62Ly+leloeu6H7m0pG7VBiU6pQk= 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/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= -github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= -github.com/hashicorp/terraform v0.12.0 h1:It2vmod2dBMB4+r+aUW2Afx0HlftyUwzNsNH3I2vrJ8= -github.com/hashicorp/terraform v0.12.0/go.mod h1:Ke0ig9gGZ8rhV6OddAhBYt5nXmpvXsuNQQ8w9qYBZfU= -github.com/hashicorp/terraform-config-inspect v0.0.0-20190327195015-8022a2663a70 h1:oZm5nE11yhzsTRz/YrUyDMSvixePqjoZihwn8ipuOYI= -github.com/hashicorp/terraform-config-inspect v0.0.0-20190327195015-8022a2663a70/go.mod h1:ItvqtvbC3K23FFET62ZwnkwtpbKZm8t8eMcWjmVVjD8= -github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-plugin-go v0.22.0 h1:1OS1Jk5mO0f5hrziWJGXXIxBrMe2j/B8E+DVGw43Xmc= +github.com/hashicorp/terraform-plugin-go v0.22.0/go.mod h1:mPULV91VKss7sik6KFEcEu7HuTogMLLO/EvWCuFkRVE= +github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= +github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-mux v0.15.0 h1:+/+lDx0WUsIOpkAmdwBIoFU8UP9o2eZASoOnLsWbKME= +github.com/hashicorp/terraform-plugin-mux v0.15.0/go.mod h1:9ezplb1Dyq394zQ+ldB0nvy/qbNAz3mMoHHseMTMaKo= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= +github.com/hashicorp/terraform-plugin-testing v1.7.0 h1:I6aeCyZ30z4NiI3tzyDoO6fS7YxP5xSL1ceOon3gTe8= +github.com/hashicorp/terraform-plugin-testing v1.7.0/go.mod h1:sbAreCleJNOCz+y5vVHV8EJkIWZKi/t4ndKiUjM9vao= +github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= +github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/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 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +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/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/panicwrap v0.0.0-20190213213626-17011010aaa4/go.mod h1:YYMf4xtQnR8LRC0vKi3afvQ5QwRPQ17zjcpkBCufb+I= -github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= -github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +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/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= -github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= -github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= -github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= -github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= -github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= -github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= -github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= -github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= -github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= -github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spf13/afero v1.2.1 h1:qgMbHoJbPbw579P+1zVY+6n4nIFuIchaIjzZ/I/Yq8M= -github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= -github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= -github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= -github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= -github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +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/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zclconf/go-cty v0.0.0-20181129180422-88fbe721e0f8/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v0.0.0-20190426224007-b18a157db9e2/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v0.0.0-20190516203816-4fecf87372ec h1:MSeYjmyjucsFbecMTxg63ASg23lcSARP/kr9sClTFfk= -github.com/zclconf/go-cty v0.0.0-20190516203816-4fecf87372ec/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= -golang.org/x/crypto v0.0.0-20180816225734-aabede6cba87/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.14.3 h1:1JXy1XroaGrzZuG6X9dt7HL6s9AwbY+l4UNL8o5B6ho= +github.com/zclconf/go-cty v1.14.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181129055619-fae4c4e3ad76/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/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/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-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190220154721-9b3c75971fc9 h1:pfyU+l9dEu0vZzDDMsdAKa1gZbJYEn6urYXj/+Xkz7s= -golang.org/x/oauth2 v0.0.0-20190220154721-9b3c75971fc9/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= 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/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef h1:fPxZ3Umkct3LZ8gK9nbk+DWDJ9fstZa2grBn+lWVKPs= -golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0 h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922 h1:mBVYJnbrXLA/ZCBTCe7PtEgAUP+1bg92qTaFoPHdz+8= -google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.18.0 h1:IZl7mfBGfbhYx2p2rKRtYgDFw6SBz+kclmxYrCksPPA= -google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +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.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 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/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index 6552b582..0ec51629 100644 --- a/main.go +++ b/main.go @@ -20,11 +20,49 @@ package main import ( - "github.com/hashicorp/terraform/plugin" + "context" + "flag" + "log" + + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server" + "github.com/hashicorp/terraform-plugin-mux/tf5muxserver" + "github.com/terraform-providers/terraform-provider-cloudstack/cloudstack" ) func main() { - plugin.Serve(&plugin.ServeOpts{ - ProviderFunc: cloudstack.Provider}) + ctx := context.Background() + + var debug bool + + flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve") + flag.Parse() + + providers := []func() tfprotov5.ProviderServer{ + cloudstack.New().GRPCProvider, + } + + muxServer, err := tf5muxserver.NewMuxServer(ctx, providers...) + + if err != nil { + log.Fatal(err) + } + + var serveOpts []tf5server.ServeOpt + + if debug { + serveOpts = append(serveOpts, tf5server.WithManagedDebug()) + } + + err = tf5server.Serve( + "registry.terraform.io/cloudstack/cloudstack", + muxServer.ProviderServer, + serveOpts..., + ) + + if err != nil { + log.Fatal(err) + } + } diff --git a/scripts/errcheck.sh b/scripts/errcheck.sh index 9c589f77..761a3774 100755 --- a/scripts/errcheck.sh +++ b/scripts/errcheck.sh @@ -28,7 +28,7 @@ if ! which errcheck > /dev/null; then fi err_files=$(errcheck -ignoretests \ - -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \ + -ignore 'github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:Set' \ -ignore 'bytes:.*' \ -ignore 'io:Close|Write' \ $(go list ./...| grep -v /vendor/))