diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b6e6376b8..584035f61 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,6 +23,7 @@ jobs: - Iam - Instance - Iot + - IPAM - K8S - Lb - Marketplace diff --git a/docs/resources/ipam_ip.md b/docs/resources/ipam_ip.md new file mode 100644 index 000000000..b3fee11d2 --- /dev/null +++ b/docs/resources/ipam_ip.md @@ -0,0 +1,113 @@ +--- +subcategory: "IPAM" +page_title: "Scaleway: scaleway_ipam_ip" +--- + +# scaleway_ipam_ip + +Books and manages Scaleway IPAM IPs. + +## Example + +### Basic + +```hcl +resource "scaleway_vpc" "vpc01" { + name = "my vpc" +} + +resource "scaleway_vpc_private_network" "pn01" { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } +} + +resource "scaleway_ipam_ip" "ip01" { + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } +} +``` + +### Request a specific IPv4 + +```hcl +resource "scaleway_vpc" "vpc01" { + name = "my vpc" +} + +resource "scaleway_vpc_private_network" "pn01" { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } +} + +resource "scaleway_ipam_ip" "ip01" { + address = "172.16.32.7/22" + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } +} +``` + +### Request an IPv6 + +```hcl +resource "scaleway_vpc" "vpc01" { + name = "my vpc" +} + +resource "scaleway_vpc_private_network" "pn01" { + vpc_id = scaleway_vpc.vpc01.id + ipv6_subnets { + subnet = "fd46:78ab:30b8:177c::/64" + } +} + +resource "scaleway_ipam_ip" "ip01" { + is_ipv6 = true + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } +} +``` + +## Arguments Reference + +The following arguments are supported: + +- `address` - (Optional) Request a specific IP in the requested source pool. +- `tags` - (Optional) The tags associated with the IP. +- `source` - (Required) The source in which to book the IP. + - `zonal` - The zone the IP lives in if the IP is a public zoned one + - `private_network_id` - The private network the IP lives in if the IP is a private IP. + - `subnet_id` - The private network subnet the IP lives in if the IP is a private IP in a private network. +- `is_ipv6` - (Optional) Defines whether to request an IPv6 instead of an IPv4. +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) of the IP. +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the IP is associated with. + +## Attributes Reference + +In addition to all above arguments, the following attributes are exported: + +- `id` - The ID of the IP in IPAM. +- `resource` - The IP resource. + - `id` - The ID of the resource that the IP is bound to. + - `type` - The type of resource the IP is attached to. + - `name` - The name of the resource the IP is attached to. + - `mac_address` - The MAC Address of the resource the IP is attached to. +- `created_at` - Date and time of IP's creation (RFC 3339 format). +- `updated_at` - Date and time of IP's last update (RFC 3339 format). +- `zone` - The zone of the IP. + +~> **Important:** IPAM IPs' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111 + +## Import + +IPAM IPs can be imported using the `{region}/{id}`, e.g. + +```bash +$ terraform import scaleway_ipam_ip.ip_demo fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/scaleway/helpers.go b/scaleway/helpers.go index 20c802103..eaf458144 100644 --- a/scaleway/helpers.go +++ b/scaleway/helpers.go @@ -1137,3 +1137,27 @@ func testAccCheckScalewayResourceIDChanged(resourceName string, resourceID *stri return nil } } + +// testAccCheckScalewayResourceRawIDMatches asserts the equality of IDs from two specified attributes of two Scaleway resources. +func testAccCheckScalewayResourceRawIDMatches(res1, attr1, res2, attr2 string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs1, ok1 := s.RootModule().Resources[res1] + if !ok1 { + return fmt.Errorf("not found: %s", res1) + } + + rs2, ok2 := s.RootModule().Resources[res2] + if !ok2 { + return fmt.Errorf("not found: %s", res2) + } + + id1 := expandID(rs1.Primary.Attributes[attr1]) + id2 := expandID(rs2.Primary.Attributes[attr2]) + + if id1 != id2 { + return fmt.Errorf("ID mismatch: %s from resource %s does not match ID %s from resource %s", id1, res1, id2, res2) + } + + return nil + } +} diff --git a/scaleway/helpers_instance.go b/scaleway/helpers_instance.go index a86389771..982766c90 100644 --- a/scaleway/helpers_instance.go +++ b/scaleway/helpers_instance.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/scaleway/scaleway-sdk-go/api/instance/v1" - "github.com/scaleway/scaleway-sdk-go/api/vpc/v1" + "github.com/scaleway/scaleway-sdk-go/api/vpc/v2" "github.com/scaleway/scaleway-sdk-go/scw" ) @@ -292,15 +292,19 @@ func preparePrivateNIC( zonedID, pnExist := r["pn_id"] privateNetworkID := expandID(zonedID.(string)) if pnExist { + region, err := server.Zone.Region() + if err != nil { + return nil, err + } currentPN, err := vpcAPI.GetPrivateNetwork(&vpc.GetPrivateNetworkRequest{ PrivateNetworkID: expandID(privateNetworkID), - Zone: server.Zone, + Region: region, }, scw.WithContext(ctx)) if err != nil { return nil, err } query := &instance.CreatePrivateNICRequest{ - Zone: currentPN.Zone, + Zone: server.Zone, ServerID: server.ID, PrivateNetworkID: currentPN.ID, } diff --git a/scaleway/helpers_ipam.go b/scaleway/helpers_ipam.go index c20a1baf0..2521114fe 100644 --- a/scaleway/helpers_ipam.go +++ b/scaleway/helpers_ipam.go @@ -1,6 +1,7 @@ package scaleway import ( + "net" "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,6 +23,18 @@ func ipamAPIWithRegion(d *schema.ResourceData, m interface{}) (*ipam.API, scw.Re return ipamAPI, region, nil } +// ipamAPIWithRegionAndID returns a new ipam API with locality and ID extracted from the state +func ipamAPIWithRegionAndID(m interface{}, id string) (*ipam.API, scw.Region, string, error) { + meta := m.(*Meta) + ipamAPI := ipam.NewAPI(meta.scwClient) + + region, ID, err := parseRegionalID(id) + if err != nil { + return nil, "", "", err + } + return ipamAPI, region, ID, err +} + // expandLastID expand the last ID in a potential composed ID // region/id1/id2 -> id2 // region/id1 -> id1 @@ -39,3 +52,78 @@ func expandLastID(i interface{}) string { return composedID } + +func expandIPSource(raw interface{}) *ipam.Source { + if raw == nil || len(raw.([]interface{})) != 1 { + return nil + } + + rawMap := raw.([]interface{})[0].(map[string]interface{}) + return &ipam.Source{ + Zonal: expandStringPtr(rawMap["zonal"].(string)), + PrivateNetworkID: expandStringPtr(expandID(rawMap["private_network_id"].(string))), + SubnetID: expandStringPtr(rawMap["subnet_id"].(string)), + } +} + +func flattenIPSource(source *ipam.Source, privateNetworkID string) interface{} { + if source == nil { + return nil + } + return []map[string]interface{}{ + { + "zonal": flattenStringPtr(source.Zonal), + "private_network_id": privateNetworkID, + "subnet_id": flattenStringPtr(source.SubnetID), + }, + } +} + +func flattenIPResource(resource *ipam.Resource) interface{} { + if resource == nil { + return nil + } + return []map[string]interface{}{ + { + "type": resource.Type.String(), + "id": resource.ID, + "mac_address": flattenStringPtr(resource.MacAddress), + "name": flattenStringPtr(resource.Name), + }, + } +} + +func checkSubnetIDInFlattenedSubnets(subnetID string, flattenedSubnets interface{}) bool { + for _, subnet := range flattenedSubnets.([]map[string]interface{}) { + if subnet["id"].(string) == subnetID { + return true + } + } + return false +} + +func diffSuppressFuncStandaloneIPandCIDR(k, old, new string, _ *schema.ResourceData) bool { + oldIP, oldNet, errOld := net.ParseCIDR(old) + if errOld != nil { + oldIP = net.ParseIP(old) + } + + newIP, newNet, errNew := net.ParseCIDR(new) + if errNew != nil { + newIP = net.ParseIP(new) + } + + if oldIP != nil && newIP != nil && oldIP.Equal(newIP) { + return true + } + + if oldNet != nil && newIP != nil && oldNet.Contains(newIP) { + return true + } + + if newNet != nil && oldIP != nil && newNet.Contains(oldIP) { + return true + } + + return false +} diff --git a/scaleway/helpers_vpc.go b/scaleway/helpers_vpc.go index a7973e49e..9778f03db 100644 --- a/scaleway/helpers_vpc.go +++ b/scaleway/helpers_vpc.go @@ -51,13 +51,13 @@ func vpcAPIWithRegionAndID(m interface{}, id string) (*v2.API, scw.Region, strin return vpcAPI, region, ID, err } -func vpcAPI(m interface{}) (*v1.API, error) { +func vpcAPI(m interface{}) (*v2.API, error) { meta, ok := m.(*Meta) if !ok { return nil, fmt.Errorf("wrong type: %T", m) } - return v1.NewAPI(meta.scwClient), nil + return v2.NewAPI(meta.scwClient), nil } func expandSubnets(d *schema.ResourceData) (ipv4Subnets []scw.IPNet, ipv6Subnets []scw.IPNet, err error) { diff --git a/scaleway/provider.go b/scaleway/provider.go index cfe0b4aa5..06e299fac 100644 --- a/scaleway/provider.go +++ b/scaleway/provider.go @@ -133,6 +133,7 @@ func Provider(config *ProviderConfig) plugin.ProviderFunc { "scaleway_iot_device": resourceScalewayIotDevice(), "scaleway_iot_route": resourceScalewayIotRoute(), "scaleway_iot_network": resourceScalewayIotNetwork(), + "scaleway_ipam_ip": resourceScalewayIPAMIP(), "scaleway_k8s_cluster": resourceScalewayK8SCluster(), "scaleway_k8s_pool": resourceScalewayK8SPool(), "scaleway_lb": resourceScalewayLb(), diff --git a/scaleway/resource_ipam_ip.go b/scaleway/resource_ipam_ip.go new file mode 100644 index 000000000..9d5815590 --- /dev/null +++ b/scaleway/resource_ipam_ip.go @@ -0,0 +1,271 @@ +package scaleway + +import ( + "context" + "fmt" + "net" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/scaleway/scaleway-sdk-go/api/ipam/v1" + "github.com/scaleway/scaleway-sdk-go/api/vpc/v2" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +func resourceScalewayIPAMIP() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceScalewayIPAMIPCreate, + ReadContext: resourceScalewayIPAMIPRead, + UpdateContext: resourceScalewayIPAMIPUpdate, + DeleteContext: resourceScalewayIPAMIPDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 0, + Schema: map[string]*schema.Schema{ + "address": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Request a specific IP in the requested source pool", + ValidateFunc: validateStandaloneIPorCIDR(), + DiffSuppressFunc: diffSuppressFuncStandaloneIPandCIDR, + }, + "source": { + Type: schema.TypeList, + Required: true, + Description: "The source in which to book the IP", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "zonal": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Zone the IP lives in if the IP is a public zoned one", + }, + "private_network_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Private Network the IP lives in if the IP is a private IP", + DiffSuppressFunc: diffSuppressFuncLocality, + }, + "subnet_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Private Network subnet the IP lives in if the IP is a private IP in a Private Network", + }, + }, + }, + }, + "is_ipv6": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Default: false, + Description: "Request an IPv6 instead of an IPv4", + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Description: "The tags associated with the IP", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "project_id": projectIDSchema(), + "region": regionSchema(), + // Computed elements + "resource": { + Type: schema.TypeList, + Computed: true, + Description: "The IP resource", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of resource the IP is attached to", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "ID of the resource the IP is attached to", + }, + "mac_address": { + Type: schema.TypeString, + Computed: true, + Description: "MAC of the resource the IP is attached to", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the resource the IP is attached to", + }, + }, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the creation of the IP", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time of the last update of the IP", + }, + "zone": zoneComputedSchema(), + }, + } +} + +func resourceScalewayIPAMIPCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + ipamApi, region, err := ipamAPIWithRegion(d, meta) + if err != nil { + return diag.FromErr(err) + } + + req := &ipam.BookIPRequest{ + Region: region, + ProjectID: d.Get("project_id").(string), + IsIPv6: d.Get("is_ipv6").(bool), + Tags: expandStrings(d.Get("tags")), + } + + address, addressOk := d.GetOk("address") + if addressOk { + addressStr := address.(string) + parsedIP, _, err := net.ParseCIDR(addressStr) + if err != nil { + parsedIP = net.ParseIP(addressStr) + if parsedIP == nil { + return diag.FromErr(fmt.Errorf("error parsing IP address: %s", err)) + } + } + req.Address = scw.IPPtr(parsedIP) + } + + if source, ok := d.GetOk("source"); ok { + req.Source = expandIPSource(source) + } + + res, err := ipamApi.BookIP(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(newRegionalIDString(region, res.ID)) + + return resourceScalewayIPAMIPRead(ctx, d, meta) +} + +func resourceScalewayIPAMIPRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + ipamApi, region, ID, err := ipamAPIWithRegionAndID(meta, d.Id()) + if err != nil { + return diag.FromErr(err) + } + vpcAPI, err := vpcAPI(meta) + if err != nil { + return diag.FromErr(err) + } + + res, err := ipamApi.GetIP(&ipam.GetIPRequest{ + Region: region, + IPID: ID, + }, scw.WithContext(ctx)) + if err != nil { + if is404Error(err) { + d.SetId("") + return nil + } + return diag.FromErr(err) + } + + privateNetworkID := "" + if source, ok := d.GetOk("source"); ok { + sourceData := expandIPSource(source) + if sourceData.PrivateNetworkID != nil { + pn, err := vpcAPI.GetPrivateNetwork(&vpc.GetPrivateNetworkRequest{ + PrivateNetworkID: *sourceData.PrivateNetworkID, + Region: region, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + ipv4Subnets, ipv6Subnets := flattenAndSortSubnets(pn.Subnets) + found := false + + // Check if the subnet ID is present in the flattened subnets based on the "is_ipv6" field. + if d.Get("is_ipv6").(bool) { + found = checkSubnetIDInFlattenedSubnets(*res.Source.SubnetID, ipv6Subnets) + } else { + found = checkSubnetIDInFlattenedSubnets(*res.Source.SubnetID, ipv4Subnets) + } + + // If found, set the private network ID in the resource state + if found { + privateNetworkID = pn.ID + } + } + + } + + address, err := flattenIPNet(res.Address) + if err != nil { + return diag.FromErr(err) + } + _ = d.Set("address", address) + _ = d.Set("source", flattenIPSource(res.Source, privateNetworkID)) + _ = d.Set("resource", flattenIPResource(res.Resource)) + _ = d.Set("project_id", res.ProjectID) + _ = d.Set("created_at", flattenTime(res.CreatedAt)) + _ = d.Set("updated_at", flattenTime(res.UpdatedAt)) + _ = d.Set("is_ipv6", res.IsIPv6) + _ = d.Set("region", region) + if res.Zone != nil { + _ = d.Set("zone", res.Zone.String()) + } + if len(res.Tags) > 0 { + _ = d.Set("tags", res.Tags) + } + + return nil +} + +func resourceScalewayIPAMIPUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + ipamApi, region, ID, err := ipamAPIWithRegionAndID(meta, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + _, err = ipamApi.UpdateIP(&ipam.UpdateIPRequest{ + IPID: ID, + Region: region, + Tags: expandUpdatedStringsPtr(d.Get("tags")), + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + return resourceScalewayIPAMIPRead(ctx, d, meta) +} + +func resourceScalewayIPAMIPDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + ipamApi, region, ID, err := ipamAPIWithRegionAndID(meta, d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = ipamApi.ReleaseIP(&ipam.ReleaseIPRequest{ + Region: region, + IPID: ID, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + return nil +} diff --git a/scaleway/resource_ipam_ip_test.go b/scaleway/resource_ipam_ip_test.go new file mode 100644 index 000000000..72b3013b6 --- /dev/null +++ b/scaleway/resource_ipam_ip_test.go @@ -0,0 +1,281 @@ +package scaleway + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/scaleway/scaleway-sdk-go/api/ipam/v1" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +func init() { + resource.AddTestSweepers("scaleway_ipam_ip", &resource.Sweeper{ + Name: "scaleway_ipam_ip", + F: testSweepIPAMIP, + }) +} + +func testSweepIPAMIP(_ string) error { + return sweepRegions(scw.AllRegions, func(scwClient *scw.Client, region scw.Region) error { + ipamAPI := ipam.NewAPI(scwClient) + + l.Debugf("sweeper: deleting the IPs in (%s)", region) + + listIPs, err := ipamAPI.ListIPs(&ipam.ListIPsRequest{Region: region}, scw.WithAllPages()) + if err != nil { + return fmt.Errorf("error listing ips in (%s) in sweeper: %s", region, err) + } + + for _, v := range listIPs.IPs { + err := ipamAPI.ReleaseIP(&ipam.ReleaseIPRequest{ + IPID: v.ID, + Region: region, + }) + if err != nil { + l.Debugf("sweeper: error (%s)", err) + + return fmt.Errorf("error releasing IP in sweeper: %s", err) + } + } + + return nil + }) +} + +func TestAccScalewayIPAMIP_Basic(t *testing.T) { + tt := NewTestTools(t) + defer tt.Cleanup() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckScalewayIPAMIPDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource scaleway_vpc vpc01 { + name = "my vpc" + } + + resource scaleway_vpc_private_network pn01 { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } + } + + resource scaleway_ipam_ip ip01 { + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckScalewayIPAMIPExists(tt, "scaleway_ipam_ip.ip01"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "is_ipv6", "false"), + testAccCheckScalewayResourceRawIDMatches("scaleway_ipam_ip.ip01", "source.0.private_network_id", "scaleway_vpc_private_network.pn01", "id"), + resource.TestCheckResourceAttrSet("scaleway_ipam_ip.ip01", "source.0.subnet_id"), + resource.TestCheckResourceAttrSet("scaleway_ipam_ip.ip01", "address"), + resource.TestCheckResourceAttrSet("scaleway_ipam_ip.ip01", "created_at"), + resource.TestCheckResourceAttrSet("scaleway_ipam_ip.ip01", "updated_at"), + ), + }, + }, + }) +} + +func TestAccScalewayIPAMIP_WithStandaloneAddress(t *testing.T) { + tt := NewTestTools(t) + defer tt.Cleanup() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckScalewayIPAMIPDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource scaleway_vpc vpc01 { + name = "my vpc" + } + + resource scaleway_vpc_private_network pn01 { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } + } + + resource scaleway_ipam_ip ip01 { + address = "172.16.32.7" + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckScalewayIPAMIPExists(tt, "scaleway_ipam_ip.ip01"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "address", "172.16.32.7/22"), + ), + }, + }, + }) +} +func TestAccScalewayIPAMIP_WithCIDRAddress(t *testing.T) { + tt := NewTestTools(t) + defer tt.Cleanup() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckScalewayIPAMIPDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource scaleway_vpc vpc01 { + name = "my vpc" + } + + resource scaleway_vpc_private_network pn01 { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } + } + + resource scaleway_ipam_ip ip01 { + address = "172.16.32.5/22" + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckScalewayIPAMIPExists(tt, "scaleway_ipam_ip.ip01"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "address", "172.16.32.5/22"), + ), + }, + }, + }) +} + +func TestAccScalewayIPAMIP_WithTags(t *testing.T) { + tt := NewTestTools(t) + defer tt.Cleanup() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: testAccCheckScalewayIPAMIPDestroy(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource scaleway_vpc vpc01 { + name = "my vpc" + } + + resource scaleway_vpc_private_network pn01 { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } + } + + resource scaleway_ipam_ip ip01 { + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } + tags = [ "terraform-test", "ipam" ] + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckScalewayIPAMIPExists(tt, "scaleway_ipam_ip.ip01"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.#", "2"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.0", "terraform-test"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.1", "ipam"), + ), + }, + { + Config: ` + resource scaleway_vpc vpc01 { + name = "my vpc" + } + + resource scaleway_vpc_private_network pn01 { + vpc_id = scaleway_vpc.vpc01.id + ipv4_subnet { + subnet = "172.16.32.0/22" + } + } + + resource scaleway_ipam_ip ip01 { + source { + private_network_id = scaleway_vpc_private_network.pn01.id + } + tags = [ "terraform-test", "ipam", "updated" ] + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckScalewayIPAMIPExists(tt, "scaleway_ipam_ip.ip01"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.#", "3"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.0", "terraform-test"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.1", "ipam"), + resource.TestCheckResourceAttr("scaleway_ipam_ip.ip01", "tags.2", "updated"), + ), + }, + }, + }) +} + +func testAccCheckScalewayIPAMIPExists(tt *TestTools, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource not found: %s", n) + } + + ipamApi, region, ID, err := ipamAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = ipamApi.GetIP(&ipam.GetIPRequest{ + IPID: ID, + Region: region, + }) + + if err != nil { + return err + } + + return nil + } +} + +func testAccCheckScalewayIPAMIPDestroy(tt *TestTools) resource.TestCheckFunc { + return func(state *terraform.State) error { + for _, rs := range state.RootModule().Resources { + if rs.Type != "scaleway_ipam_ip" { + continue + } + + ipamApi, region, ID, err := ipamAPIWithRegionAndID(tt.Meta, rs.Primary.ID) + if err != nil { + return err + } + + _, err = ipamApi.GetIP(&ipam.GetIPRequest{ + IPID: ID, + Region: region, + }) + + if err == nil { + return fmt.Errorf("IP (%s) still exists", rs.Primary.ID) + } + + if !is404Error(err) { + return err + } + } + + return nil + } +} diff --git a/scaleway/resource_vpc_private_network_test.go b/scaleway/resource_vpc_private_network_test.go index 61876536f..337a22fe6 100644 --- a/scaleway/resource_vpc_private_network_test.go +++ b/scaleway/resource_vpc_private_network_test.go @@ -12,8 +12,9 @@ import ( func init() { resource.AddTestSweepers("scaleway_vpc_private_network", &resource.Sweeper{ - Name: "scaleway_vpc_private_network", - F: testSweepVPCPrivateNetwork, + Name: "scaleway_vpc_private_network", + F: testSweepVPCPrivateNetwork, + Dependencies: []string{"scaleway_ipam_ip"}, }) } diff --git a/scaleway/testdata/ipamip-basic.cassette.yaml b/scaleway/testdata/ipamip-basic.cassette.yaml new file mode 100644 index 000000000..80e5003ab --- /dev/null +++ b/scaleway/testdata/ipamip-basic.cassette.yaml @@ -0,0 +1,536 @@ +--- +version: 1 +interactions: +- request: + body: '{"name":"my vpc","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs + method: POST + response: + body: '{"created_at":"2023-10-27T07:17:20.025687Z","id":"e49f4d63-a354-40bf-a77a-71a88206128d","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-27T07:17:20.025687Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cf278fb3-2692-4150-9c95-9b796379ad41 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/e49f4d63-a354-40bf-a77a-71a88206128d + method: GET + response: + body: '{"created_at":"2023-10-27T07:17:20.025687Z","id":"e49f4d63-a354-40bf-a77a-71a88206128d","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-27T07:17:20.025687Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 490217b7-caa0-4a0b-a409-67cfcbbdd55c + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"name":"tf-pn-gifted-tesla","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null,"subnets":["172.16.32.0/22"],"vpc_id":"e49f4d63-a354-40bf-a77a-71a88206128d"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks + method: POST + response: + body: '{"created_at":"2023-10-27T07:17:20.230502Z","dhcp_enabled":true,"id":"dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d","name":"tf-pn-gifted-tesla","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-27T07:17:20.230502Z","id":"51e5b8a8-b307-465e-a47e-b296a3064812","subnet":"172.16.32.0/22","updated_at":"2023-10-27T07:17:20.230502Z"},{"created_at":"2023-10-27T07:17:20.230502Z","id":"c5a11d0a-c730-44f8-8304-09792660b8a8","subnet":"fd46:78ab:30b8:3e08::/64","updated_at":"2023-10-27T07:17:20.230502Z"}],"tags":[],"updated_at":"2023-10-27T07:17:20.230502Z","vpc_id":"e49f4d63-a354-40bf-a77a-71a88206128d"}' + headers: + Content-Length: + - "719" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 832349a1-9311-4a84-a816-ff85bca6b327 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d + method: GET + response: + body: '{"created_at":"2023-10-27T07:17:20.230502Z","dhcp_enabled":true,"id":"dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d","name":"tf-pn-gifted-tesla","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-27T07:17:20.230502Z","id":"51e5b8a8-b307-465e-a47e-b296a3064812","subnet":"172.16.32.0/22","updated_at":"2023-10-27T07:17:20.230502Z"},{"created_at":"2023-10-27T07:17:20.230502Z","id":"c5a11d0a-c730-44f8-8304-09792660b8a8","subnet":"fd46:78ab:30b8:3e08::/64","updated_at":"2023-10-27T07:17:20.230502Z"}],"tags":[],"updated_at":"2023-10-27T07:17:20.230502Z","vpc_id":"e49f4d63-a354-40bf-a77a-71a88206128d"}' + headers: + Content-Length: + - "719" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 054baf85-17a9-48cb-8fbf-b17becb07634 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","source":{"private_network_id":"dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d"},"is_ipv6":false,"address":null,"tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips + method: POST + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-27T07:17:21.212540Z","id":"06d6d1a9-3284-4f94-9538-01c8dd8f8390","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"51e5b8a8-b307-465e-a47e-b296a3064812"},"tags":[],"updated_at":"2023-10-27T07:17:21.212540Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f5ca73de-effb-477d-b8c0-bff38330a024 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/06d6d1a9-3284-4f94-9538-01c8dd8f8390 + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-27T07:17:21.212540Z","id":"06d6d1a9-3284-4f94-9538-01c8dd8f8390","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"51e5b8a8-b307-465e-a47e-b296a3064812"},"tags":[],"updated_at":"2023-10-27T07:17:21.212540Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 175277e8-09c2-42b1-aa16-a4c16ce2b51b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d + method: GET + response: + body: '{"created_at":"2023-10-27T07:17:20.230502Z","dhcp_enabled":true,"id":"dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d","name":"tf-pn-gifted-tesla","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-27T07:17:20.230502Z","id":"51e5b8a8-b307-465e-a47e-b296a3064812","subnet":"172.16.32.0/22","updated_at":"2023-10-27T07:17:20.230502Z"},{"created_at":"2023-10-27T07:17:20.230502Z","id":"c5a11d0a-c730-44f8-8304-09792660b8a8","subnet":"fd46:78ab:30b8:3e08::/64","updated_at":"2023-10-27T07:17:20.230502Z"}],"tags":[],"updated_at":"2023-10-27T07:17:20.230502Z","vpc_id":"e49f4d63-a354-40bf-a77a-71a88206128d"}' + headers: + Content-Length: + - "719" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a4707ac8-5ab4-4d5e-a409-ba07d17fbb65 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/06d6d1a9-3284-4f94-9538-01c8dd8f8390 + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-27T07:17:21.212540Z","id":"06d6d1a9-3284-4f94-9538-01c8dd8f8390","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"51e5b8a8-b307-465e-a47e-b296a3064812"},"tags":[],"updated_at":"2023-10-27T07:17:21.212540Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f165a018-14ba-4519-9e1c-45208807a258 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/e49f4d63-a354-40bf-a77a-71a88206128d + method: GET + response: + body: '{"created_at":"2023-10-27T07:17:20.025687Z","id":"e49f4d63-a354-40bf-a77a-71a88206128d","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-27T07:17:20.025687Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a4468786-9447-4c43-b3af-0d3d49dfcb09 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d + method: GET + response: + body: '{"created_at":"2023-10-27T07:17:20.230502Z","dhcp_enabled":true,"id":"dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d","name":"tf-pn-gifted-tesla","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-27T07:17:20.230502Z","id":"51e5b8a8-b307-465e-a47e-b296a3064812","subnet":"172.16.32.0/22","updated_at":"2023-10-27T07:17:20.230502Z"},{"created_at":"2023-10-27T07:17:20.230502Z","id":"c5a11d0a-c730-44f8-8304-09792660b8a8","subnet":"fd46:78ab:30b8:3e08::/64","updated_at":"2023-10-27T07:17:20.230502Z"}],"tags":[],"updated_at":"2023-10-27T07:17:20.230502Z","vpc_id":"e49f4d63-a354-40bf-a77a-71a88206128d"}' + headers: + Content-Length: + - "719" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a022390d-ed49-449a-af72-2f62f3af36f4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/06d6d1a9-3284-4f94-9538-01c8dd8f8390 + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-27T07:17:21.212540Z","id":"06d6d1a9-3284-4f94-9538-01c8dd8f8390","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"51e5b8a8-b307-465e-a47e-b296a3064812"},"tags":[],"updated_at":"2023-10-27T07:17:21.212540Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 12d26c15-c869-488d-9dfa-f56244147d2f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d + method: GET + response: + body: '{"created_at":"2023-10-27T07:17:20.230502Z","dhcp_enabled":true,"id":"dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d","name":"tf-pn-gifted-tesla","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-27T07:17:20.230502Z","id":"51e5b8a8-b307-465e-a47e-b296a3064812","subnet":"172.16.32.0/22","updated_at":"2023-10-27T07:17:20.230502Z"},{"created_at":"2023-10-27T07:17:20.230502Z","id":"c5a11d0a-c730-44f8-8304-09792660b8a8","subnet":"fd46:78ab:30b8:3e08::/64","updated_at":"2023-10-27T07:17:20.230502Z"}],"tags":[],"updated_at":"2023-10-27T07:17:20.230502Z","vpc_id":"e49f4d63-a354-40bf-a77a-71a88206128d"}' + headers: + Content-Length: + - "719" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7938a46f-94f2-4085-8589-f375ac0ec3f4 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/06d6d1a9-3284-4f94-9538-01c8dd8f8390 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 729b1add-2b6f-4e43-8b7c-3cb543d7c6ba + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/dd7a6c72-9dc4-4b24-9e7a-0046e2ad858d + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:25 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 16744d49-71e8-4220-9508-9afdeb716c98 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/e49f4d63-a354-40bf-a77a-71a88206128d + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:25 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 13db11e8-bd9a-43f5-aecb-e0d638677a33 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/06d6d1a9-3284-4f94-9538-01c8dd8f8390 + method: GET + response: + body: '{"message":"resource is not found","resource":"ip","resource_id":"06d6d1a9-3284-4f94-9538-01c8dd8f8390","type":"not_found"}' + headers: + Content-Length: + - "123" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 27 Oct 2023 07:17:25 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f4fb72c6-798b-4c0a-a526-66f75c0ce2db + status: 404 Not Found + code: 404 + duration: "" diff --git a/scaleway/testdata/ipamip-with-cidr-address.cassette.yaml b/scaleway/testdata/ipamip-with-cidr-address.cassette.yaml new file mode 100644 index 000000000..bedbd8a6d --- /dev/null +++ b/scaleway/testdata/ipamip-with-cidr-address.cassette.yaml @@ -0,0 +1,536 @@ +--- +version: 1 +interactions: +- request: + body: '{"name":"my vpc","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs + method: POST + response: + body: '{"created_at":"2023-10-26T19:00:45.458328Z","id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:00:45.458328Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:45 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6c3bca02-d169-4add-8d41-795b0b514856 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/71f2a3bf-e5d1-4381-9c0f-bf656254108d + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:45.458328Z","id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:00:45.458328Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:46 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5fa7018e-1d95-45d0-b1e9-e6eed30d3180 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"name":"tf-pn-distracted-bartik","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null,"subnets":["172.16.32.0/22"],"vpc_id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks + method: POST + response: + body: '{"created_at":"2023-10-26T19:00:46.231044Z","dhcp_enabled":true,"id":"f77c2976-764a-4d2a-b001-4f42708d53c3","name":"tf-pn-distracted-bartik","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:46.231044Z","id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:46.231044Z"},{"created_at":"2023-10-26T19:00:46.231044Z","id":"1febe4ae-c49e-43cc-be0b-0f0d025b48b9","subnet":"fd46:78ab:30b8:b6b::/64","updated_at":"2023-10-26T19:00:46.231044Z"}],"tags":[],"updated_at":"2023-10-26T19:00:46.231044Z","vpc_id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d"}' + headers: + Content-Length: + - "723" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:47 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9ec06757-325f-498c-a242-116a4804882c + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/f77c2976-764a-4d2a-b001-4f42708d53c3 + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:46.231044Z","dhcp_enabled":true,"id":"f77c2976-764a-4d2a-b001-4f42708d53c3","name":"tf-pn-distracted-bartik","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:46.231044Z","id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:46.231044Z"},{"created_at":"2023-10-26T19:00:46.231044Z","id":"1febe4ae-c49e-43cc-be0b-0f0d025b48b9","subnet":"fd46:78ab:30b8:b6b::/64","updated_at":"2023-10-26T19:00:46.231044Z"}],"tags":[],"updated_at":"2023-10-26T19:00:46.231044Z","vpc_id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d"}' + headers: + Content-Length: + - "723" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:47 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1abac1f9-941f-4aaa-8687-85ada82b5131 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","source":{"private_network_id":"f77c2976-764a-4d2a-b001-4f42708d53c3"},"is_ipv6":false,"address":"172.16.32.5","tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips + method: POST + response: + body: '{"address":"172.16.32.5/22","created_at":"2023-10-26T19:00:48.050923Z","id":"f2ebb1de-3845-4ffb-8595-032b4ce49413","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37"},"tags":[],"updated_at":"2023-10-26T19:00:48.050923Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:48 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 42f04862-48b9-4c84-93bc-4c4076c7329f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/f2ebb1de-3845-4ffb-8595-032b4ce49413 + method: GET + response: + body: '{"address":"172.16.32.5/22","created_at":"2023-10-26T19:00:48.050923Z","id":"f2ebb1de-3845-4ffb-8595-032b4ce49413","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37"},"tags":[],"updated_at":"2023-10-26T19:00:48.050923Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:48 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 81531933-1c2a-4a6f-b94e-53bc969eacf8 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/f77c2976-764a-4d2a-b001-4f42708d53c3 + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:46.231044Z","dhcp_enabled":true,"id":"f77c2976-764a-4d2a-b001-4f42708d53c3","name":"tf-pn-distracted-bartik","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:46.231044Z","id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:46.231044Z"},{"created_at":"2023-10-26T19:00:46.231044Z","id":"1febe4ae-c49e-43cc-be0b-0f0d025b48b9","subnet":"fd46:78ab:30b8:b6b::/64","updated_at":"2023-10-26T19:00:46.231044Z"}],"tags":[],"updated_at":"2023-10-26T19:00:46.231044Z","vpc_id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d"}' + headers: + Content-Length: + - "723" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:48 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 08c40a31-c878-4a81-8a8f-be6871d58d91 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/f2ebb1de-3845-4ffb-8595-032b4ce49413 + method: GET + response: + body: '{"address":"172.16.32.5/22","created_at":"2023-10-26T19:00:48.050923Z","id":"f2ebb1de-3845-4ffb-8595-032b4ce49413","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37"},"tags":[],"updated_at":"2023-10-26T19:00:48.050923Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:48 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fb7f60f2-8612-4be0-ba27-1a253c5f5ea4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/71f2a3bf-e5d1-4381-9c0f-bf656254108d + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:45.458328Z","id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:00:45.458328Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:49 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fa9c0520-1845-4d86-ab1d-e802e78a42be + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/f77c2976-764a-4d2a-b001-4f42708d53c3 + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:46.231044Z","dhcp_enabled":true,"id":"f77c2976-764a-4d2a-b001-4f42708d53c3","name":"tf-pn-distracted-bartik","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:46.231044Z","id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:46.231044Z"},{"created_at":"2023-10-26T19:00:46.231044Z","id":"1febe4ae-c49e-43cc-be0b-0f0d025b48b9","subnet":"fd46:78ab:30b8:b6b::/64","updated_at":"2023-10-26T19:00:46.231044Z"}],"tags":[],"updated_at":"2023-10-26T19:00:46.231044Z","vpc_id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d"}' + headers: + Content-Length: + - "723" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:49 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fb11496a-2f2b-47c8-9c8c-675e41cf3e44 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/f2ebb1de-3845-4ffb-8595-032b4ce49413 + method: GET + response: + body: '{"address":"172.16.32.5/22","created_at":"2023-10-26T19:00:48.050923Z","id":"f2ebb1de-3845-4ffb-8595-032b4ce49413","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37"},"tags":[],"updated_at":"2023-10-26T19:00:48.050923Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:49 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 52201479-abc9-4e5d-993b-698b8a98796f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/f77c2976-764a-4d2a-b001-4f42708d53c3 + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:46.231044Z","dhcp_enabled":true,"id":"f77c2976-764a-4d2a-b001-4f42708d53c3","name":"tf-pn-distracted-bartik","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:46.231044Z","id":"e726046d-f1e6-4900-9bfd-1f5ad6109b37","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:46.231044Z"},{"created_at":"2023-10-26T19:00:46.231044Z","id":"1febe4ae-c49e-43cc-be0b-0f0d025b48b9","subnet":"fd46:78ab:30b8:b6b::/64","updated_at":"2023-10-26T19:00:46.231044Z"}],"tags":[],"updated_at":"2023-10-26T19:00:46.231044Z","vpc_id":"71f2a3bf-e5d1-4381-9c0f-bf656254108d"}' + headers: + Content-Length: + - "723" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:49 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 32d1857b-5f21-4f48-9d5a-54f9f674de2b + status: 200 OK + code: 200 + duration: "" +- request: + body: '{}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/f2ebb1de-3845-4ffb-8595-032b4ce49413 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:49 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 354d8a61-1902-4b9c-a9c6-3e7c62c65e34 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/f77c2976-764a-4d2a-b001-4f42708d53c3 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:50 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 778ce5a9-fbd9-42c0-8d53-d94354d2a3a3 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/71f2a3bf-e5d1-4381-9c0f-bf656254108d + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:50 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9a03f5d3-4fc1-4054-98a3-fde85b794880 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/f2ebb1de-3845-4ffb-8595-032b4ce49413 + method: GET + response: + body: '{"message":"resource is not found","resource":"ip","resource_id":"f2ebb1de-3845-4ffb-8595-032b4ce49413","type":"not_found"}' + headers: + Content-Length: + - "123" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:50 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 49b3c60d-8718-4336-9110-3c185277b4fc + status: 404 Not Found + code: 404 + duration: "" diff --git a/scaleway/testdata/ipamip-with-standalone-address.cassette.yaml b/scaleway/testdata/ipamip-with-standalone-address.cassette.yaml new file mode 100644 index 000000000..db1bd6132 --- /dev/null +++ b/scaleway/testdata/ipamip-with-standalone-address.cassette.yaml @@ -0,0 +1,536 @@ +--- +version: 1 +interactions: +- request: + body: '{"name":"my vpc","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs + method: POST + response: + body: '{"created_at":"2023-10-26T19:00:18.405617Z","id":"6bd910ce-2f73-4da2-869c-30c182b2ed71","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:00:18.405617Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:19 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 153cae87-48a8-46ac-bae0-d0247617a7e4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/6bd910ce-2f73-4da2-869c-30c182b2ed71 + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:18.405617Z","id":"6bd910ce-2f73-4da2-869c-30c182b2ed71","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:00:18.405617Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:19 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b90cc3f9-6b16-4305-82d4-975e7ae17f2c + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"name":"tf-pn-crazy-antonelli","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null,"subnets":["172.16.32.0/22"],"vpc_id":"6bd910ce-2f73-4da2-869c-30c182b2ed71"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks + method: POST + response: + body: '{"created_at":"2023-10-26T19:00:19.286251Z","dhcp_enabled":true,"id":"0f3af6a7-c162-4aaa-b873-648e3c8a43aa","name":"tf-pn-crazy-antonelli","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:19.286251Z","id":"4c234232-f57c-4dee-85c6-afd677335800","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:19.286251Z"},{"created_at":"2023-10-26T19:00:19.286251Z","id":"2b24e65c-11ae-4c3c-abe5-1223ffce240c","subnet":"fd46:78ab:30b8:4328::/64","updated_at":"2023-10-26T19:00:19.286251Z"}],"tags":[],"updated_at":"2023-10-26T19:00:19.286251Z","vpc_id":"6bd910ce-2f73-4da2-869c-30c182b2ed71"}' + headers: + Content-Length: + - "722" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bd194501-af40-48cd-9e3b-170ff762a869 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/0f3af6a7-c162-4aaa-b873-648e3c8a43aa + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:19.286251Z","dhcp_enabled":true,"id":"0f3af6a7-c162-4aaa-b873-648e3c8a43aa","name":"tf-pn-crazy-antonelli","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:19.286251Z","id":"4c234232-f57c-4dee-85c6-afd677335800","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:19.286251Z"},{"created_at":"2023-10-26T19:00:19.286251Z","id":"2b24e65c-11ae-4c3c-abe5-1223ffce240c","subnet":"fd46:78ab:30b8:4328::/64","updated_at":"2023-10-26T19:00:19.286251Z"}],"tags":[],"updated_at":"2023-10-26T19:00:19.286251Z","vpc_id":"6bd910ce-2f73-4da2-869c-30c182b2ed71"}' + headers: + Content-Length: + - "722" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b554cc20-58ef-4717-8e47-9b495f23ca98 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","source":{"private_network_id":"0f3af6a7-c162-4aaa-b873-648e3c8a43aa"},"is_ipv6":false,"address":"172.16.32.7","tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips + method: POST + response: + body: '{"address":"172.16.32.7/22","created_at":"2023-10-26T19:00:21.090791Z","id":"eb7e2099-49a1-4d85-ac5e-9bf414885d86","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"4c234232-f57c-4dee-85c6-afd677335800"},"tags":[],"updated_at":"2023-10-26T19:00:21.090791Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a13e7e2f-2fa5-446b-ab8f-33a747e5ed97 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/eb7e2099-49a1-4d85-ac5e-9bf414885d86 + method: GET + response: + body: '{"address":"172.16.32.7/22","created_at":"2023-10-26T19:00:21.090791Z","id":"eb7e2099-49a1-4d85-ac5e-9bf414885d86","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"4c234232-f57c-4dee-85c6-afd677335800"},"tags":[],"updated_at":"2023-10-26T19:00:21.090791Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2c7fbd5f-da46-4b16-8d14-8a2c2fe78e66 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/0f3af6a7-c162-4aaa-b873-648e3c8a43aa + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:19.286251Z","dhcp_enabled":true,"id":"0f3af6a7-c162-4aaa-b873-648e3c8a43aa","name":"tf-pn-crazy-antonelli","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:19.286251Z","id":"4c234232-f57c-4dee-85c6-afd677335800","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:19.286251Z"},{"created_at":"2023-10-26T19:00:19.286251Z","id":"2b24e65c-11ae-4c3c-abe5-1223ffce240c","subnet":"fd46:78ab:30b8:4328::/64","updated_at":"2023-10-26T19:00:19.286251Z"}],"tags":[],"updated_at":"2023-10-26T19:00:19.286251Z","vpc_id":"6bd910ce-2f73-4da2-869c-30c182b2ed71"}' + headers: + Content-Length: + - "722" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - de43bd9b-834e-4d2c-b2d1-7901c90f66a6 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/eb7e2099-49a1-4d85-ac5e-9bf414885d86 + method: GET + response: + body: '{"address":"172.16.32.7/22","created_at":"2023-10-26T19:00:21.090791Z","id":"eb7e2099-49a1-4d85-ac5e-9bf414885d86","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"4c234232-f57c-4dee-85c6-afd677335800"},"tags":[],"updated_at":"2023-10-26T19:00:21.090791Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 23bb6711-1900-4c6c-ab05-7385fed2240a + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/6bd910ce-2f73-4da2-869c-30c182b2ed71 + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:18.405617Z","id":"6bd910ce-2f73-4da2-869c-30c182b2ed71","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:00:18.405617Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:21 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9106be42-1a46-4c58-94e2-89f851793eb8 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/0f3af6a7-c162-4aaa-b873-648e3c8a43aa + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:19.286251Z","dhcp_enabled":true,"id":"0f3af6a7-c162-4aaa-b873-648e3c8a43aa","name":"tf-pn-crazy-antonelli","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:19.286251Z","id":"4c234232-f57c-4dee-85c6-afd677335800","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:19.286251Z"},{"created_at":"2023-10-26T19:00:19.286251Z","id":"2b24e65c-11ae-4c3c-abe5-1223ffce240c","subnet":"fd46:78ab:30b8:4328::/64","updated_at":"2023-10-26T19:00:19.286251Z"}],"tags":[],"updated_at":"2023-10-26T19:00:19.286251Z","vpc_id":"6bd910ce-2f73-4da2-869c-30c182b2ed71"}' + headers: + Content-Length: + - "722" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - efc0d7a0-1699-4ea3-8603-0260d82cd26c + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/eb7e2099-49a1-4d85-ac5e-9bf414885d86 + method: GET + response: + body: '{"address":"172.16.32.7/22","created_at":"2023-10-26T19:00:21.090791Z","id":"eb7e2099-49a1-4d85-ac5e-9bf414885d86","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"4c234232-f57c-4dee-85c6-afd677335800"},"tags":[],"updated_at":"2023-10-26T19:00:21.090791Z","zone":null}' + headers: + Content-Length: + - "354" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3a426b96-6ef7-488c-b6d3-ce9ad6be4147 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/0f3af6a7-c162-4aaa-b873-648e3c8a43aa + method: GET + response: + body: '{"created_at":"2023-10-26T19:00:19.286251Z","dhcp_enabled":true,"id":"0f3af6a7-c162-4aaa-b873-648e3c8a43aa","name":"tf-pn-crazy-antonelli","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:00:19.286251Z","id":"4c234232-f57c-4dee-85c6-afd677335800","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:00:19.286251Z"},{"created_at":"2023-10-26T19:00:19.286251Z","id":"2b24e65c-11ae-4c3c-abe5-1223ffce240c","subnet":"fd46:78ab:30b8:4328::/64","updated_at":"2023-10-26T19:00:19.286251Z"}],"tags":[],"updated_at":"2023-10-26T19:00:19.286251Z","vpc_id":"6bd910ce-2f73-4da2-869c-30c182b2ed71"}' + headers: + Content-Length: + - "722" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 29d8f8a4-0e65-4218-bd07-769550711683 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/eb7e2099-49a1-4d85-ac5e-9bf414885d86 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:22 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 56e34b1b-3e76-4912-b148-71fda764a980 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/0f3af6a7-c162-4aaa-b873-648e3c8a43aa + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:23 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7c88f2eb-fcc9-4105-bb3a-8e623fed355f + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/6bd910ce-2f73-4da2-869c-30c182b2ed71 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:23 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 843c13bf-e94f-4e9f-908e-7fdee0710e4b + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/eb7e2099-49a1-4d85-ac5e-9bf414885d86 + method: GET + response: + body: '{"message":"resource is not found","resource":"ip","resource_id":"eb7e2099-49a1-4d85-ac5e-9bf414885d86","type":"not_found"}' + headers: + Content-Length: + - "123" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:00:23 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a32b27af-a23f-4823-92f9-d8d7297f6a47 + status: 404 Not Found + code: 404 + duration: "" diff --git a/scaleway/testdata/ipamip-with-tags.cassette.yaml b/scaleway/testdata/ipamip-with-tags.cassette.yaml new file mode 100644 index 000000000..afca8e09d --- /dev/null +++ b/scaleway/testdata/ipamip-with-tags.cassette.yaml @@ -0,0 +1,936 @@ +--- +version: 1 +interactions: +- request: + body: '{"name":"my vpc","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs + method: POST + response: + body: '{"created_at":"2023-10-26T19:02:10.016697Z","id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:02:10.016697Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:10 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 63b1d617-cc51-43ea-8b23-b016923535ab + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ca381d94-7d2c-4eb4-a057-2f29b172d5a6 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.016697Z","id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":0,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:02:10.016697Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:10 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 59a182f0-70b6-4a78-ab2b-7d48b03e54f8 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"name":"tf-pn-dreamy-wilbur","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","tags":null,"subnets":["172.16.32.0/22"],"vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks + method: POST + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:12 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 45e9e325-f57d-4f4a-8692-a03563ab7c67 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:12 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a06628d8-6dad-433e-826e-9c2054369873 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","source":{"private_network_id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724"},"is_ipv6":false,"address":null,"tags":["terraform-test","ipam"]}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips + method: POST + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam"],"updated_at":"2023-10-26T19:02:14.940347Z","zone":null}' + headers: + Content-Length: + - "378" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ee460b81-f8d6-4397-a245-cd75223197c7 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam"],"updated_at":"2023-10-26T19:02:14.940347Z","zone":null}' + headers: + Content-Length: + - "378" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fa8cac75-c512-40d8-b9f2-e8d092474b52 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 29a86581-7013-4022-9804-a02fc0298351 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam"],"updated_at":"2023-10-26T19:02:14.940347Z","zone":null}' + headers: + Content-Length: + - "378" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bf149e7b-b7a8-40a8-a4fe-ab15799e2699 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ca381d94-7d2c-4eb4-a057-2f29b172d5a6 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.016697Z","id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:02:10.016697Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d338c872-da70-4c1f-9a28-34bd2491d35d + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 33a95d85-5a5d-4707-96be-9fb8bc044143 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam"],"updated_at":"2023-10-26T19:02:14.940347Z","zone":null}' + headers: + Content-Length: + - "378" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 11eeae40-6541-46f6-84a0-d8c4c8dbf0d7 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:15 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 33632dda-e83a-4a14-88e1-d393854bdca3 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ca381d94-7d2c-4eb4-a057-2f29b172d5a6 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.016697Z","id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:02:10.016697Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:16 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c034b63b-9e2d-476d-9943-c169b9eadb8d + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:16 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 230de42e-6198-42d4-aab7-bf16e62fa669 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam"],"updated_at":"2023-10-26T19:02:14.940347Z","zone":null}' + headers: + Content-Length: + - "378" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:16 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3793c426-5aae-4120-9477-7c40b705ccb3 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:16 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 274c7a07-0d99-421b-aafb-0ec178d2d423 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"tags":["terraform-test","ipam","updated"]}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: PATCH + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam","updated"],"updated_at":"2023-10-26T19:02:16.996834Z","zone":null}' + headers: + Content-Length: + - "389" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:17 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d402da5a-b3d2-45e2-a3bd-8736f70e9111 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam","updated"],"updated_at":"2023-10-26T19:02:16.996834Z","zone":null}' + headers: + Content-Length: + - "389" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:17 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - aa85bf86-3e26-441a-be98-dcfc4186ccdf + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:17 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4bb6a66d-d909-4644-ad1c-e9c6c48b4a6b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam","updated"],"updated_at":"2023-10-26T19:02:16.996834Z","zone":null}' + headers: + Content-Length: + - "389" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:18 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 69e7f1b8-c151-4217-a92b-0a0bfde3f55f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ca381d94-7d2c-4eb4-a057-2f29b172d5a6 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.016697Z","id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6","is_default":false,"name":"my + vpc","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","private_network_count":1,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","tags":[],"updated_at":"2023-10-26T19:02:10.016697Z"}' + headers: + Content-Length: + - "338" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:18 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d422a363-8b11-4f25-ac29-95e9536b84d8 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:18 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 8499558e-7c0d-4a69-971f-ade46764656f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"address":"172.16.32.2/22","created_at":"2023-10-26T19:02:14.940347Z","id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","is_ipv6":false,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","resource":null,"source":{"subnet_id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be"},"tags":["terraform-test","ipam","updated"],"updated_at":"2023-10-26T19:02:16.996834Z","zone":null}' + headers: + Content-Length: + - "389" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:18 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 91bd1cd5-fb45-4041-b4e9-28082580befa + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: GET + response: + body: '{"created_at":"2023-10-26T19:02:10.193726Z","dhcp_enabled":true,"id":"bf8c0e33-53e3-41be-9572-9a5bd05cd724","name":"tf-pn-dreamy-wilbur","organization_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","region":"fr-par","subnets":[{"created_at":"2023-10-26T19:02:10.193726Z","id":"a4d9561b-7dce-44f3-94d6-70f8f91b19be","subnet":"172.16.32.0/22","updated_at":"2023-10-26T19:02:10.193726Z"},{"created_at":"2023-10-26T19:02:10.193726Z","id":"fcc509a4-fe2b-4b03-a790-d1674177fd46","subnet":"fd46:78ab:30b8:5245::/64","updated_at":"2023-10-26T19:02:10.193726Z"}],"tags":[],"updated_at":"2023-10-26T19:02:10.193726Z","vpc_id":"ca381d94-7d2c-4eb4-a057-2f29b172d5a6"}' + headers: + Content-Length: + - "720" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:18 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d335da89-9a18-47d4-8c59-cde21937eab4 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:19 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ff8ef23d-b7b9-4a0d-a6b3-955fb44809f9 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/private-networks/bf8c0e33-53e3-41be-9572-9a5bd05cd724 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 438fb404-89f4-4d2a-aed8-795b2e53ebf3 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/vpc/v2/regions/fr-par/vpcs/ca381d94-7d2c-4eb4-a057-2f29b172d5a6 + method: DELETE + response: + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 440da796-0071-4fe2-a2fd-9cbb6ddaf730 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.3; darwin; amd64) terraform-provider/develop + terraform/terraform-tests + url: https://api.scaleway.com/ipam/v1/regions/fr-par/ips/a5c4a240-2e76-4b24-b508-1df8d8538aed + method: GET + response: + body: '{"message":"resource is not found","resource":"ip","resource_id":"a5c4a240-2e76-4b24-b508-1df8d8538aed","type":"not_found"}' + headers: + Content-Length: + - "123" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 26 Oct 2023 19:02:20 GMT + Server: + - Scaleway API-Gateway + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 43e73093-f398-45c8-914e-2725fa13f2d9 + status: 404 Not Found + code: 404 + duration: ""