Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scaleway/terraform-provider-scaleway
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 86894ec3001fb3d5e55fa2f11253b5c9420bc3e5
Choose a base ref
..
head repository: scaleway/terraform-provider-scaleway
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9cd738c253736cd482df4fa2b626bc77fd63e63a
Choose a head ref
Showing 2,357 changed files with 759 additions and 750,872 deletions.
9 changes: 8 additions & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Support

Terraform is a mature project with a growing community. There are active, dedicated people willing to help you through various mediums.
## Terraform help

Terraform is a mature project with a growing community.
There are active, dedicated people willing to help you through various mediums.

Take a look at those mediums listed at https://www.terraform.io/community.html

## Scaleway provider

Feel free to come ask for help on our [Community Slack](https://slack.scaleway.com/) (#opensource)
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
on:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
-
name: Import GPG key
id: import_gpg
run: |
gpg-agent --daemon --allow-preset-passphrase
gpg --batch --import --yes <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
export KEY_FINGERPRINT=$(gpg --list-secret-keys --with-colons | grep sec | cut -d ':' -f 5)
export KEY_GRIP=$(gpg-connect-agent 'KEYINFO --list' /bye | grep KEYINFO | cut -d ' ' -f 3)
export PASSPHRASE_HEX=$(echo -n "${{ secrets.GPG_PASSPHRASE }}" | xxd -p -u -c 265)
gpg-connect-agent "PRESET_PASSPHRASE $KEY_GRIP -1 $PASSPHRASE_HEX" /bye
echo "::set-output name=fingerprint::$KEY_FINGERPRINT"
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on:
pull_request:

jobs:
tests:
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Build binaries
run: make build
- name: Run unit tests
run: make test
- name: Check with go vet
run: make vet
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -31,3 +31,6 @@ website/vendor
# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/

# Local release artifacts
dist/
53 changes: 53 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
before:
hooks:
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X github.com/scaleway/terraform-provider-scaleway/scaleway.version={{.Version}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
args:
# if you are using this is a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
# Manually examine the release before its live
draft: true
changelog:
skip: false
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
## 1.16.0 (Unreleased)
## 1.17.0 (Unreleased)
## 1.16.0 (June 29, 2020)

IMPROVEMENTS:

* **New Data source** `data-source/scaleway_lb_ip` ([#493](https://github.com/terraform-providers/terraform-provider-scaleway/pull/493)).
* `resource/scaleway_instance_security_group` add stateful field to security group ([#497](https://github.com/terraform-providers/terraform-provider-scaleway/pull/497)).

BUG FIXES:

* `resource/scaleway_k8s_cluster_beta` use resource region on versions calls ([#492](https://github.com/terraform-providers/terraform-provider-scaleway/pull/492)).
* `resource/scaleway_k8s_cluster_beta` add missing region argument on pool creation ([#494](https://github.com/terraform-providers/terraform-provider-scaleway/pull/494)).
* `resource/scaleway_k8s_pool_beta` fix pool size and autoscaling ([#498](https://github.com/terraform-providers/terraform-provider-scaleway/pull/498)).
* `resource/scaleway_instance_security_group` fix ipv6 security rule validation ([#482](https://github.com/terraform-providers/terraform-provider-scaleway/pull/482)).
* `resource/scaleway_lb_beta` fix case problem with lb type ([#515](https://github.com/terraform-providers/terraform-provider-scaleway/pull/515)).


## 1.15.0 (April 29, 2020)

BREAKING CHANGES:
17 changes: 2 additions & 15 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -49,20 +49,7 @@ test-compile:
go test -c $(TEST) $(TESTARGS)

website:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), getting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
cd $(GOPATH)/src/$(WEBSITE_REPO) && git submodule init ext/providers/$(PKG_NAME) && git submodule update
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
@echo "Use this site to preview markdown rendering: https://registry.terraform.io/tools/doc-preview"

website-test:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), getting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
cd $(GOPATH)/src/$(WEBSITE_REPO) && git submodule init ext/providers/$(PKG_NAME) && git submodule update
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test
.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ require (
github.com/hashicorp/terraform-plugin-sdk v1.0.0
github.com/mitchellh/go-homedir v1.1.0
github.com/nicolai86/scaleway-sdk v0.0.0-20181024210327-b20018e944c4
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200619102539-dc791f6baf8c
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200923142616-ae5d7880b199
github.com/stretchr/testify v1.3.0
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
21 changes: 4 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
@@ -181,23 +181,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
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/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200213152732-b653c349beac h1:vs95YNeV7miD26crLiLEpu2q5FB4cqsXLb0a6EY2Ypk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200213152732-b653c349beac/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200214142021-a3b13afba582 h1:MfmioAzGL4x0gm2Idmemmw244hrqZK/73c93+qW+D5Q=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200214142021-a3b13afba582/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200218123949-d26e180da05a h1:wqOBg7qPWMNmdjjnxkNYjit32Zs5QwCMEuC+b+6C8cY=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200218123949-d26e180da05a/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200219165633-cc8064e6b5f1 h1:b6crXNA/2wfG1Yon7ym+/NYrATzGuwYndjO4BfeISaY=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5.0.20200219165633-cc8064e6b5f1/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6 h1:C1/pvkxkGN/H03mDxLzItaceYJDBk1HdClgR15suAzI=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200407075309-351601ab0ad3 h1:0RWvOIoHoAQCctiGlGSYrjamJaD2zIxInpEbcF9ygq8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200407075309-351601ab0ad3/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200421151545-c4338a1f64c9 h1:VExNGApruijWPXvqW/ns6wlNwxAFm/8F7KnknJn5pwc=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200421151545-c4338a1f64c9/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200429095002-79646b01c7da h1:BU7+fhbZwWErJNToCQR3ofEy7PDl1NSPdOoE/oekkQw=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200429095002-79646b01c7da/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200619102539-dc791f6baf8c h1:mOtIb2fYFzhoGuv0Lp9zy+1h4/Ujqc76iF5LULP8wZA=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200619102539-dc791f6baf8c/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200625143330-d3e0c6c20474 h1:IkOChjasZthcGbr7j/7+KDneeQb/dcwQp+GeHLpiXNE=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200625143330-d3e0c6c20474/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200923142616-ae5d7880b199 h1:SVgNpFhrq0iOwzD4y881l0Bp7FwNTTjHhMmK/05vERw=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200923142616-ae5d7880b199/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
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/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
11 changes: 11 additions & 0 deletions scaleway/config.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import (
"io/ioutil"
"net/http"
"os"
"strings"
"time"

"github.com/aws/aws-sdk-go/aws"
@@ -31,6 +32,7 @@ type Meta struct {
DefaultOrganizationID string
DefaultRegion scw.Region
DefaultZone scw.Zone
APIURL string
TerraformVersion string

// scwClient is the Scaleway SDK client.
@@ -91,6 +93,10 @@ func (m *Meta) bootstrapScwClient() error {
options = append(options, scw.WithDefaultZone(m.DefaultZone))
}

if m.APIURL != "" {
options = append(options, scw.WithAPIURL(m.APIURL))
}

client, err := scw.NewClient(options...)
if err != nil {
return fmt.Errorf("cannot create SDK client: %s", err)
@@ -167,6 +173,11 @@ func (m *Meta) bootstrapDeprecatedClient() error {
options,
)
if err != nil {
// Ugly fix bug this should be removed when we remove support for older resources.
if strings.HasSuffix(err.Error(), "isn't a valid region") {
// will panic if using the deprecated client
return nil
}
return fmt.Errorf("cannot create deprecated SDK client: %s", err)
}

6 changes: 3 additions & 3 deletions scaleway/data_source_instance_image.go
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ func dataSourceScalewayInstanceImageRead(d *schema.ResourceData, m interface{})
return fmt.Errorf("%d images found with the same name %s and architecture %s in zone %s", len(res.Images), d.Get("name"), d.Get("architecture"), zone)
}
sort.Slice(res.Images, func(i, j int) bool {
return res.Images[i].ModificationDate.After(res.Images[j].ModificationDate)
return res.Images[i].ModificationDate.After(*res.Images[j].ModificationDate)
})
imageID = res.Images[0].ID
}
@@ -138,8 +138,8 @@ func dataSourceScalewayInstanceImageRead(d *schema.ResourceData, m interface{})
_ = d.Set("architecture", resp.Image.Arch)
_ = d.Set("name", resp.Image.Name)

_ = d.Set("creation_date", flattenTime(&resp.Image.CreationDate))
_ = d.Set("modification_date", flattenTime(&resp.Image.ModificationDate))
_ = d.Set("creation_date", flattenTime(resp.Image.CreationDate))
_ = d.Set("modification_date", flattenTime(resp.Image.ModificationDate))
_ = d.Set("public", resp.Image.Public)
_ = d.Set("from_server_id", resp.Image.FromServer)
_ = d.Set("state", resp.Image.State.String())
2 changes: 1 addition & 1 deletion scaleway/data_source_marketplace_image_beta_test.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ data "scaleway_marketplace_image_beta" "test1" {
`,
Check: resource.ComposeTestCheckFunc(
testAccCheckScalewayInstanceImageExists("data.scaleway_marketplace_image_beta.test1"),
resource.TestCheckResourceAttr("data.scaleway_marketplace_image_beta.test1", "id", "fr-par-1/f974feac-abae-4365-b988-8ec7d1cec10d"),
resource.TestCheckResourceAttr("data.scaleway_marketplace_image_beta.test1", "id", "fr-par-1/cf44b8f5-77e2-42ed-8f1e-09ed5bb028fc"),
),
},
},
9 changes: 9 additions & 0 deletions scaleway/helpers_lb.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scaleway

import (
"strings"
"time"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
@@ -236,3 +237,11 @@ func expandLbCustomCertificate(raw interface{}) *lb.CreateCertificateRequestCust
}
return config
}

func expandLbProxyProtocol(raw interface{}) lb.ProxyProtocol {
return lb.ProxyProtocol("proxy_protocol_" + raw.(string))
}

func flattenLbProxyProtocol(pp lb.ProxyProtocol) interface{} {
return strings.TrimPrefix(pp.String(), "proxy_protocol_")
}
Loading