Skip to content

Commit bc155b3

Browse files
authored
bump(scaleway-sdk-go): with fix on vpc gateway state (#1243)
1 parent 0177ef4 commit bc155b3

24 files changed

+4717
-3852
lines changed

.github/workflows/acceptance-tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
TF_ACC: 1
4141
TF_UPDATE_CASSETTES: false
4242
TF_TEST_DOMAIN: scaleway-terraform.com
43+
TF_TEST_DOMAIN_ZONE: tf
4344
TF_TEST_DOCKER_IMG: docker.io/library/alpine
4445
SCW_DEBUG: 0
4546
SCW_ACCESS_KEY: "SCWXXXXXXXXXXXXXFAKE"

.github/workflows/nightly.yml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
# Enable recording with the cassette system. By doing so, we ensure that real HTTPS requests are made.
4545
TF_UPDATE_CASSETTES: true
4646
TF_TEST_DOMAIN: scaleway-terraform.com
47+
TF_TEST_DOMAIN_ZONE: tf
4748
TF_TEST_DOCKER_IMG: docker.io/library/alpine
4849
SCW_DEBUG: 1
4950
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}

TESTING.md

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ You can force the test domain with an environment var:
4646
export TF_TEST_DOMAIN=your-domain.tld
4747
```
4848

49+
For testing a domain zone you can force the following environment var:
50+
51+
```sh
52+
export TF_TEST_DOMAIN_ZONE=your-zone
53+
```
54+
4955
For testing the container API with your own image you can force the environment var:
5056

5157
```shell

docs/data-sources/vpc_public_gateway_ip.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ description: |-
88

99
Gets information about a public gateway IP.
1010

11+
For further information please check the API [documentation](https://developers.scaleway.com/en/products/vpc-gw/api/v1/#get-66f0c0)
12+
1113
## Example Usage
1214

1315
```hcl

docs/resources/vpc_public_gateway_ip.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ description: |-
77
# scaleway_vpc_public_gateway_ip
88

99
Creates and manages Scaleway VPC Public Gateway IP.
10-
For more information, see [the documentation](https://developers.scaleway.com/en/products/vpc-gw/api/v1).
10+
For more information, see [the documentation](https://developers.scaleway.com/en/products/vpc-gw/api/v1/#ips-268151).
1111

1212
## Example
1313

1414
```hcl
15-
resource "scaleway_vpc_public_gateway_ip" "main" {
16-
reverse = "example.com"
17-
tags = ["demo", "terraform"]
15+
resource "scaleway_domain_record" "tf_A" {
16+
dns_zone = "example.com"
17+
name = "tf"
18+
type = "A"
19+
data = "${scaleway_vpc_public_gateway_ip.main.address}"
20+
ttl = 3600
21+
priority = 1
22+
}
23+
24+
resource scaleway_vpc_public_gateway_ip main {
25+
reverse = "tf.example.com"
1826
}
1927
```
2028

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/hashicorp/go-retryablehttp v0.7.1
1212
github.com/hashicorp/terraform-plugin-log v0.3.0
1313
github.com/hashicorp/terraform-plugin-sdk/v2 v2.14.0
14-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220425121900-20ed4de943e7
14+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220426161756-58bfb7aeb801
1515
github.com/stretchr/testify v1.7.1
1616
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f
1717

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb
864864
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
865865
github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
866866
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
867-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220425121900-20ed4de943e7 h1:b6jogEVn0MhYYjQ537a1F898df4esAJOlGhxWxyJ1xM=
868-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220425121900-20ed4de943e7/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
867+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220426161756-58bfb7aeb801 h1:Ax1wkrzLs02Z+r+8J2jyvm4gXfoFuw/ChyPmse8hQPo=
868+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220426161756-58bfb7aeb801/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
869869
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
870870
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
871871
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=

scaleway/resource_domain_record_test.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ var (
2121
regexp.MustCompile(`.*scaleway\..*`),
2222
regexp.MustCompile(`.*dedibox.*`),
2323
}
24-
testDomain = ""
24+
testDomain = ""
25+
testDomainZone = ""
2526
)
2627

2728
func init() {
@@ -49,6 +50,17 @@ func init() {
4950
}
5051

5152
l.Infof("start domain record test with domain: %s", testDomain)
53+
54+
testDomainZonePtr := flag.String("test-domain-zone", os.Getenv("TF_TEST_DOMAIN_ZONE"), "Test domain zone")
55+
if testDomainZonePtr != nil && *testDomainZonePtr != "" {
56+
testDomainZone = *testDomainZonePtr
57+
} else {
58+
l.Infof("environment variable TF_TEST_DOMAIN_ZONE is required")
59+
60+
return
61+
}
62+
63+
l.Infof("start domain record test with domain zone: %s", testDomainZone)
5264
}
5365

5466
func TestAccScalewayDomainRecord_Basic(t *testing.T) {

scaleway/resource_instance_ip_reverse_dns_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
func TestAccScalewayInstanceIPReverseDns_Basic(t *testing.T) {
1111
tt := NewTestTools(t)
1212
defer tt.Cleanup()
13-
testDNSZone := fmt.Sprintf("tf.%s", testDomain)
13+
testDNSZone := fmt.Sprintf("%s.%s", testDomainZone, testDomain)
1414
resource.ParallelTest(t, resource.TestCase{
1515
PreCheck: func() { testAccPreCheck(t) },
1616
ProviderFactories: tt.ProviderFactories,

scaleway/resource_vpc_public_gateway_ip_test.go

+25-6
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,26 @@ func TestAccScalewayVPCPublicGatewayIP_Basic(t *testing.T) {
4646
tt := NewTestTools(t)
4747
defer tt.Cleanup()
4848

49+
testDNSZone := fmt.Sprintf("%s.%s", testDomainZone, testDomain)
4950
resource.ParallelTest(t, resource.TestCase{
5051
PreCheck: func() { testAccPreCheck(t) },
5152
ProviderFactories: tt.ProviderFactories,
5253
CheckDestroy: testAccCheckScalewayVPCPublicGatewayIPDestroy(tt),
5354
Steps: []resource.TestStep{
5455
{
55-
Config: `
56+
Config: fmt.Sprintf(`
57+
resource "scaleway_domain_record" "tf_A" {
58+
dns_zone = %[1]q
59+
name = "tf"
60+
type = "A"
61+
data = "${scaleway_vpc_public_gateway_ip.main.address}"
62+
ttl = 3600
63+
priority = 1
64+
}
65+
5666
resource scaleway_vpc_public_gateway_ip main {
5767
}
58-
`,
68+
`, testDomain),
5969
Check: resource.ComposeTestCheckFunc(
6070
testAccCheckScalewayVPCPublicGatewayIPExists(tt, "scaleway_vpc_public_gateway_ip.main"),
6171
resource.TestCheckResourceAttrSet("scaleway_vpc_public_gateway_ip.main", "reverse"),
@@ -65,17 +75,26 @@ func TestAccScalewayVPCPublicGatewayIP_Basic(t *testing.T) {
6575
),
6676
},
6777
{
68-
Config: `
78+
Config: fmt.Sprintf(`
79+
resource "scaleway_domain_record" "tf_A" {
80+
dns_zone = %[1]q
81+
name = "tf"
82+
type = "A"
83+
data = "${scaleway_vpc_public_gateway_ip.main.address}"
84+
ttl = 3600
85+
priority = 1
86+
}
87+
6988
resource scaleway_vpc_public_gateway_ip main {
70-
reverse = "example.com"
89+
reverse = %[2]q
7190
tags = ["tag0", "tag1"]
7291
}
73-
`,
92+
`, testDomain, testDNSZone),
7493
Check: resource.ComposeTestCheckFunc(
7594
testAccCheckScalewayVPCPublicGatewayIPExists(tt, "scaleway_vpc_public_gateway_ip.main"),
7695
resource.TestCheckResourceAttr("scaleway_vpc_public_gateway_ip.main", "tags.0", "tag0"),
7796
resource.TestCheckResourceAttr("scaleway_vpc_public_gateway_ip.main", "tags.1", "tag1"),
78-
resource.TestCheckResourceAttr("scaleway_vpc_public_gateway_ip.main", "reverse", "example.com"),
97+
resource.TestCheckResourceAttr("scaleway_vpc_public_gateway_ip.main", "reverse", testDNSZone),
7998
resource.TestCheckResourceAttrSet("scaleway_vpc_public_gateway_ip.main", "address"),
8099
resource.TestCheckResourceAttrSet("scaleway_vpc_public_gateway_ip.main", "created_at"),
81100
resource.TestCheckResourceAttrSet("scaleway_vpc_public_gateway_ip.main", "updated_at"),

0 commit comments

Comments
 (0)