Skip to content

Commit

Permalink
fix: merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos committed Dec 4, 2024
2 parents ed73501 + 2a48113 commit d642b16
Show file tree
Hide file tree
Showing 76 changed files with 832 additions and 177 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 6.6.6
### Features
- Add `maintenance_window`, `tier` and regional endpoints for VPN resources
### Chores
- Replace `paultyng/ghaction-import-gpg` with `crazy-max/ghaction-import-gpg`

Expand Down
4 changes: 4 additions & 0 deletions docs/data-sources/vpn_ipsec_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ The following attributes are returned by the datasource:
VPN Gateway.
* `ipv6_cidr` - Describes the ipv6 subnet in your LAN that should be accessible by the VPN Gateway.
* `version` - The IKE version that is permitted for the VPN tunnels.
* `maintenance_window` - A weekly 4 hour-long window, during which maintenance might occur.
* `time` - Start of the maintenance window in UTC time.
* `day_of_the_week` - The name of the week day.
* `tier` - Gateway performance options.
4 changes: 4 additions & 0 deletions docs/data-sources/vpn_wireguard_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ In addition to all arguments above, the following attributes are exported:
- `lan_id` - The ID of the LAN where the WireGuard Gateway is connected.
- `ipv4_cidr` - The IPv4 CIDR for the WireGuard Gateway connection.
- `ipv6_cidr` - The IPv6 CIDR for the WireGuard Gateway connection.
- `maintenance_window` - A weekly 4 hour-long window, during which maintenance might occur.
- `time` - Start of the maintenance window in UTC time.
- `day_of_the_week` - The name of the week day.
- `tier` - Gateway performance options.
2 changes: 1 addition & 1 deletion docs/resources/dataplatform_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "ionoscloud_dataplatform_cluster" "example" {
* `datacenter_id` - (Required)[string] The UUID of the virtual data center (VDC) the cluster is provisioned.
* `name` - (Required)[string] The name of your cluster. Must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]). It can contain dashes (-), underscores (_), dots (.), and alphanumerics in-between.
* `version` - (Optional)[int] The version of the Data Platform.
* `maintenance_window` - (Optional)[string] Starting time of a weekly 4 hour-long window, during which maintenance might occur in hh:mm:ss format
* `maintenance_window` - (Optional) Starting time of a weekly 4 hour-long window, during which maintenance might occur in hh:mm:ss format
* `time` - (Required)[string] Time at which the maintenance should start. Must conform to the 'HH:MM:SS' 24-hour format. This pattern matches the "HH:MM:SS 24-hour format with leading 0" format. For more information take a look at [this link](https://stackoverflow.com/questions/7536755/regular-expression-for-matching-hhmm-time-format).
* `day_of_the_week` - (Required)[string] Must be set with one the values `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday` or `Sunday`.
* `lans` - (Optional)[list] A list of LANs you want this node pool to be part of.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/dataplatform_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "ionoscloud_dataplatform_node_pool" "example" {
* `availability_zone` - (Optional)[string] The availability zone of the virtual datacenter region where the node pool resources should be provisioned. Must be set with one of the values `AUTO`, `ZONE_1` or `ZONE_2`. The default value is `AUTO`.
* `storage_type` - (Optional)[int] The type of hardware for the volume. Must be set with one of the values `HDD` or `SSD`. The default value is `SSD`.
* `storage_size` - (Optional)[int] The size of the volume in GB. The size must be greater than `10`GB. The default value is `20`.
* `maintenance_window` - (Optional)[string] Starting time of a weekly 4 hour-long window, during which maintenance might occur in hh:mm:ss format
* `maintenance_window` - (Optional) Starting time of a weekly 4 hour-long window, during which maintenance might occur in hh:mm:ss format
* `time` - (Required)[string] Time at which the maintenance should start. Must conform to the 'HH:MM:SS' 24-hour format. This pattern matches the "HH:MM:SS 24-hour format with leading 0" format. For more information take a look at [this link](https://stackoverflow.com/questions/7536755/regular-expression-for-matching-hhmm-time-format).
* `day_of_the_week` - (Required)[string] Must be set with one the values `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday` or `Sunday`.
* `labels` - (Optional)[map] Key-value pairs attached to the node pool resource as [Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/).
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/dbaas_mongo_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ resource "random_password" "cluster_password" {
* `datacenter_id` - (Required)[string] The datacenter to connect your cluster to.
* `lan_id` - (Required)[string] The LAN to connect your cluster to.
* `cidr_list` - (Required)[List] The list of IPs and subnet for your cluster. Note the following unavailable IP ranges:10.233.64.0/18, 10.233.0.0/18, 10.233.114.0/24. example: [192.168.1.100/24, 192.168.1.101/24]. See [Private IPs](https://www.ionos.com/help/server-cloud-infrastructure/private-network/private-ip-address-ranges/) and [Cluster Setup - Preparing the network](https://docs.ionos.com/cloud/databases/mongodb/api-howtos/create-a-cluster#preparing-the-network).
* `maintenance_window` - (Optional)(Computed)[string] A weekly 4 hour-long window, during which maintenance might occur. Updates to the value of the field force the cluster to be re-created.
* `maintenance_window` - (Optional)(Computed) A weekly 4 hour-long window, during which maintenance might occur. Updates to the value of the field force the cluster to be re-created.
* `time` - (Required)[string]
* `day_of_the_week` - (Required)[string]
* `connection_string` - (Computed)[string] The physical location where the cluster will be created. This will be where all of your instances live. Updates to the value of the field force the cluster to be re-created. Available locations: de/txl, gb/lhr, es/vit
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/dbaas_pgsql_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ resource "random_password" "cluster_password" {
* `location` - (Required)[string] The physical location where the cluster will be created. This will be where all of your instances live. Property cannot be modified after datacenter creation. Possible values are: `de/fra`, `de/txl`, `gb/lhr`, `es/vit`, `us/ewr`, `us/las`. This attribute is immutable(disallowed in update requests).
* `backup_location` - (Optional)(Computed)[string] The IONOS Object Storage location where the backups will be stored. Possible values are: `de`, `eu-south-2`, `eu-central-2`. This attribute is immutable (disallowed in update requests).
* `display_name` - (Required)[string] The friendly name of your cluster.
* `maintenance_window` - (Optional)(Computed)[string] A weekly 4 hour-long window, during which maintenance might occur
* `maintenance_window` - (Optional)(Computed) A weekly 4 hour-long window, during which maintenance might occur
* `time` - (Required)[string]
* `day_of_the_week` - (Required)[string]
* `credentials` - (Required)[string] Credentials for the database user to be created. This attribute is immutable(disallowed in update requests).
Expand Down
11 changes: 10 additions & 1 deletion docs/resources/vpn_ipsec_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,19 @@ resource "ionoscloud_vpn_ipsec_gateway" "example" {
ipv4_cidr = local.ipv4_cidr_block
ipv6_cidr = local.ipv6_cidr_block
}
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00"
}
tier = "STANDARD"
}
```

## Argument reference

* `name` - (Required)[string] The name of the IPSec Gateway.
* `location` - (Optional)[string] The location of the IPSec Gateway. Supported locations: de/fra, de/txl, es/vit,
gb/lhr, us/ewr, us/las, us/mci, fr/par
gb/bhx, gb/lhr, us/ewr, us/las, us/mci, fr/par.
* `gateway_ip` - (Required)[string] Public IP address to be assigned to the gateway. Note: This must be an IP address in
the same datacenter as the connections.
* `description` - (Optional)[string] The human-readable description of the IPSec Gateway.
Expand All @@ -143,6 +148,10 @@ resource "ionoscloud_vpn_ipsec_gateway" "example" {
Gateway. **Note**: this should be the subnet already assigned to the LAN
* `version` - (Required)[string] The IKE version that is permitted for the VPN tunnels. Default: `IKEv2`. Possible
values: `IKEv2`.
* `maintenance_window` - (Optional)(Computed) A weekly 4 hour-long window, during which maintenance might occur.
* `time` - (Required)[string] Start of the maintenance window in UTC time.
* `day_of_the_week` - (Required)[string] The name of the week day.
* `tier` - (Optional)(Computed)[string] Gateway performance options. See product documentation for full details. Options: STANDARD, STANDARD_HA, ENHANCED, ENHANCED_HA, PREMIUM, PREMIUM_HA.

## Import

Expand Down
13 changes: 12 additions & 1 deletion docs/resources/vpn_wireguard_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ resource "ionoscloud_vpn_wireguard_gateway" "gateway" {
lan_id = ionoscloud_lan.lan_example.id
ipv4_cidr = "192.168.1.108/24"
}
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00"
}
tier = "STANDARD"
}
```

## Argument Reference

The following arguments are supported by the `vpn_wireguard_gateway` resource:

- `location` - (Optional)[String] The location of the WireGuard Gateway.
- `location` - (Optional)[String] The location of the WireGuard Gateway. Supported locations: de/fra, de/txl, es/vit,
gb/bhx, gb/lhr, us/ewr, us/las, us/mci, fr/par.
- `name` - (Required)[String] The name of the WireGuard Gateway.
- `description` - (Optional)[String] A description of the WireGuard Gateway.
- `endpoint` - (Optional, Block) The endpoint configuration for the WireGuard Gateway. This block supports fields documented below.
Expand All @@ -65,6 +71,11 @@ The following arguments are supported by the `vpn_wireguard_gateway` resource:
- `lan_id` - (Required)[String] The ID of the LAN where the WireGuard Gateway is connected.
- `ipv4_cidr` - (Required)[String] The IPv4 CIDR for the WireGuard Gateway connection.
- `ipv6_cidr` - (Optional)[String] The IPv6 CIDR for the WireGuard Gateway connection.

- `maintenance_window` - (Optional)(Computed) A weekly 4 hour-long window, during which maintenance might occur.
- `time` - (Required)[string] Start of the maintenance window in UTC time.
- `day_of_the_week` - (Required)[string] The name of the week day.
- `tier` - (Optional)(Computed)[string] Gateway performance options. See product documentation for full details. Options: STANDARD, STANDARD_HA, ENHANCED, ENHANCED_HA, PREMIUM, PREMIUM_HA.

## Attributes Reference

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/ionos-cloud/sdk-go-api-gateway v1.0.0
github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0
github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.1
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2
github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1
github.com/ionos-cloud/sdk-go-cert-manager v1.1.0
github.com/ionos-cloud/sdk-go-container-registry v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0 h1:8fRICa4i+GJHrCgnL
github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0/go.mod h1:BF6R+j1GdJEMImxkeh32qjIVWqsBfgi6VgyfsY5ezIA=
github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1 h1:GXxdNKl7haQnHO1QewZeXazur5+LDCpHqvP+nNObGaA=
github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1/go.mod h1:N0ifRq3ENqGg6qht1WPrVgSkcavPS5SRWlNfkHUZbfQ=
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.1 h1:/CO5Y+21l9m8tkW/N/SXX6TIgJKBfEvNQ+I08GjxASU=
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.1/go.mod h1:vK1dYtZHJOgiIPEJravKDgqhAlP7TcoFgV+OXMFFUY8=
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2 h1:qR/ul88v/3ZF+ZLFFv6LE9TrjZS1qM4R10UlXCaQzcs=
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2/go.mod h1:V6WHbWsQDlZsLtHqgsXO81Z9eJBsczE3Q6VY8J+rutc=
github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1 h1:NWobgIhmUJKG6ohFXefMj+KmpEEvLYEDUgGzpns6HQE=
github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1/go.mod h1:cLIl4zmB1yMdPSNgTzaRmXeuusEAY1O3Lp/iXSc/R6E=
github.com/ionos-cloud/sdk-go-cert-manager v1.1.0 h1:6lM1RoBc6Epw3g7B6CKWoKGsUDP+IPoA4m8+gtYrbOY=
Expand Down
22 changes: 22 additions & 0 deletions ionoscloud/data_source_vpn_ipsec_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@ func dataSourceVpnIPSecGateway() *schema.Resource {
Description: "The IKE version that is permitted for the VPN tunnels.",
Computed: true,
},
"maintenance_window": {
Type: schema.TypeList,
Description: "a weekly 4 hour-long window, during which maintenance might occur",
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"time": {
Type: schema.TypeString,
Computed: true,
},
"day_of_the_week": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"tier": {
Type: schema.TypeString,
Description: "Gateway performance options",
Computed: true,
},
},
}
}
Expand Down
22 changes: 22 additions & 0 deletions ionoscloud/data_source_vpn_wireguard_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,28 @@ func dataSourceVpnWireguardGateway() *schema.Resource {
Description: "The status of the WireGuard Gateway",
Computed: true,
},
"maintenance_window": {
Type: schema.TypeList,
Description: "a weekly 4 hour-long window, during which maintenance might occur",
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"time": {
Type: schema.TypeString,
Computed: true,
},
"day_of_the_week": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"tier": {
Type: schema.TypeString,
Description: "Gateway performance options",
Computed: true,
},
},
}
}
Expand Down
31 changes: 29 additions & 2 deletions ionoscloud/resource_vpn_ipsec_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/vpn"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant"
)

func resourceVpnIPSecGateway() *schema.Resource {
Expand All @@ -36,7 +37,7 @@ func resourceVpnIPSecGateway() *schema.Resource {
"location": {
Type: schema.TypeString,
Description: fmt.Sprintf("The location of the IPSec Gateway. Supported locations: %s", strings.Join(vpn.AvailableLocations, ", ")),
Required: true,
Optional: true,
ForceNew: true,
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice(vpn.AvailableLocations, false)),
},
Expand All @@ -50,7 +51,6 @@ func resourceVpnIPSecGateway() *schema.Resource {
Type: schema.TypeList,
Description: "The network connection for your gateway. Note: all connections must belong to the same datacenter.",
MinItems: 1,
MaxItems: 10,
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -87,6 +87,33 @@ func resourceVpnIPSecGateway() *schema.Resource {
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"IKEv2"}, false)),
Default: "IKEv2",
},
"maintenance_window": {
Type: schema.TypeList,
Description: "A weekly 4 hour-long window, during which maintenance might occur",
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"time": {
Type: schema.TypeString,
Description: "Start of the maintenance window in UTC time.",
Required: true,
},
"day_of_the_week": {
Type: schema.TypeString,
Description: "The name of the week day",
Required: true,
},
},
},
},
"tier": {
Type: schema.TypeString,
Description: "Gateway performance options. See the documentation for the available options",
Default: constant.DefaultTier,
Optional: true,
},
},
Timeouts: &resourceDefaultTimeouts,
Importer: &schema.ResourceImporter{
Expand Down
11 changes: 11 additions & 0 deletions ionoscloud/resource_vpn_ipsec_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ func checkIPSecGatewayResourceAttributes(fullResourceName, attributeNameReferenc
resource.TestCheckResourceAttrPair(fullResourceName, "connections.0.datacenter_id", "ionoscloud_datacenter.test_datacenter", "id"),
resource.TestCheckResourceAttrPair(fullResourceName, "connections.0.lan_id", "ionoscloud_lan.test_lan", "id"),
resource.TestCheckResourceAttrSet(fullResourceName, "connections.0.ipv4_cidr"),
resource.TestCheckResourceAttr(fullResourceName, "maintenance_window.0.day_of_the_week", "Monday"),
resource.TestCheckResourceAttr(fullResourceName, "maintenance_window.0.time", "09:00:00"),
resource.TestCheckResourceAttr(fullResourceName, "tier", "STANDARD"),
//resource.TestCheckResourceAttrSet(fullResourceName, "connections.0.ipv6_cidr"),
)
}
Expand All @@ -138,6 +141,9 @@ func checkIPSecGatewayResourceAttributesComparative(fullResourceName, fullRefere
resource.TestCheckResourceAttrPair(fullResourceName, "connections.0.datacenter_id", fullReferenceResourceName, "connections.0.datacenter_id"),
resource.TestCheckResourceAttrPair(fullResourceName, "connections.0.lan_id", fullReferenceResourceName, "connections.0.lan_id"),
resource.TestCheckResourceAttrPair(fullResourceName, "connections.0.ipv4_cidr", fullReferenceResourceName, "connections.0.ipv4_cidr"),
resource.TestCheckResourceAttrPair(fullResourceName, "maintenance_window.0.day_of_the_week", fullReferenceResourceName, "maintenance_window.0.day_of_the_week"),
resource.TestCheckResourceAttrPair(fullResourceName, "maintenance_window.0.time", fullReferenceResourceName, "maintenance_window.0.time"),
resource.TestCheckResourceAttrPair(fullResourceName, "tier", fullReferenceResourceName, "tier"),
//resource.TestCheckResourceAttrPair(fullResourceName, "connections.0.ipv6_cidr", fullReferenceResourceName, "connections.0.ipv6_cidr"),
)
}
Expand Down Expand Up @@ -195,6 +201,11 @@ resource "ionoscloud_vpn_ipsec_gateway" "%v" {
lan_id = ionoscloud_lan.test_lan.id
ipv4_cidr = local.ipv4_cidr_block
}
maintenance_window {
day_of_the_week = "Monday"
time = "09:00:00"
}
tier = "STANDARD"
}`

const templateIPSecGatewayDataIDConfig = `
Expand Down
38 changes: 33 additions & 5 deletions ionoscloud/resource_vpn_wireguard_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/vpn"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils"
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant"
)

func resourceVpnWireguardGateway() *schema.Resource {
Expand All @@ -36,14 +37,14 @@ func resourceVpnWireguardGateway() *schema.Resource {
Required: true,
},
"location": {
Type: schema.TypeString,
Description: fmt.Sprintf("The location of the WireGuard Gateway. Supported locations: %s", strings.Join(vpn.AvailableLocations, ", ")),
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Description: fmt.Sprintf("The location of the WireGuard Gateway. Supported locations: %s", strings.Join(vpn.AvailableLocations, ", ")),
Optional: true,
ForceNew: true,
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice(vpn.AvailableLocations, false)),
},
"connections": {
MinItems: 1,
MaxItems: 10,
Type: schema.TypeList,
Required: true,
Elem: &schema.Resource{
Expand Down Expand Up @@ -109,6 +110,33 @@ func resourceVpnWireguardGateway() *schema.Resource {
Description: "The status of the WireGuard Gateway",
Computed: true,
},
"maintenance_window": {
Type: schema.TypeList,
Description: "A weekly 4 hour-long window, during which maintenance might occur",
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"time": {
Type: schema.TypeString,
Description: "Start of the maintenance window in UTC time.",
Required: true,
},
"day_of_the_week": {
Type: schema.TypeString,
Description: "The name of the week day",
Required: true,
},
},
},
},
"tier": {
Type: schema.TypeString,
Description: "Gateway performance options. See the documentation for the available options",
Default: constant.DefaultTier,
Optional: true,
},
},
Timeouts: &resourceDefaultTimeouts,
}
Expand Down
Loading

0 comments on commit d642b16

Please sign in to comment.