Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/data-sources/vpn_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ data "stackit_vpn_gateway" "example" {
- `plan_id` (String) The service plan identifier (e.g. `p500`). For guidance on finding available plans, see [List available service plans](https://docs.stackit.cloud/products/network/connectivity-hybrid-multi-cloud/vpn/getting-started/gateway-create/#list-available-service-plans).
- `region` (String) STACKIT region name the resource is located in. If not defined, the provider region is used.
- `routing_type` (String) Routing architecture. Possible values are: `POLICY_BASED`, `ROUTE_BASED`, `BGP_ROUTE_BASED`.
- `state` (String) The current lifecycle state of the gateway. Possible values are: `PENDING`, `READY`, `ERROR`, `DELETING`.

<a id="nestedatt--availability_zones"></a>
### Nested Schema for `availability_zones`
Expand Down
1 change: 0 additions & 1 deletion docs/resources/vpn_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import {

- `gateway_id` (String) The server-generated UUID of the VPN gateway.
- `id` (String) Terraform's internal resource identifier. Structured as "`project_id`,`region`,`gateway_id`".
- `state` (String) The current lifecycle state of the gateway. Possible values are: `PENDING`, `READY`, `ERROR`, `DELETING`.

<a id="nestedatt--availability_zones"></a>
### Nested Schema for `availability_zones`
Expand Down
4 changes: 0 additions & 4 deletions stackit/internal/services/vpn/gateway/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ func (d *vpnGatewayDataSource) Schema(_ context.Context, _ datasource.SchemaRequ
Computed: true,
ElementType: types.StringType,
},
"state": schema.StringAttribute{
Description: schemaDescriptions["state"],
Computed: true,
},
},
}
}
Expand Down
11 changes: 0 additions & 11 deletions stackit/internal/services/vpn/gateway/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ var (
_ resource.ResourceWithModifyPlan = &gatewayResource{}
_ resource.ResourceWithValidateConfig = &gatewayResource{}

gatewayStates = sdkUtils.EnumSliceToStringSlice(vpn.AllowedGatewayStatusEnumValues)
routingTypeOptions = sdkUtils.EnumSliceToStringSlice(vpn.AllowedRoutingTypeEnumValues)
)

Expand All @@ -66,7 +65,6 @@ type Model struct {
AvailabilityZones *AvailabilityZonesModel `tfsdk:"availability_zones"`
Bgp *BGPGatewayConfigModel `tfsdk:"bgp"`
Labels types.Map `tfsdk:"labels"`
State types.String `tfsdk:"state"`
}

var schemaDescriptions = map[string]string{
Expand All @@ -84,7 +82,6 @@ var schemaDescriptions = map[string]string{
"bgp_local_asn": "Local ASN for BGP (private ASN range, 64512-4294967294).",
"bgp_override_advertised_routes": "List of IPv4 CIDRs to advertise via BGP. If omitted, SNA network ranges are advertised.",
"labels": "Map of custom labels (key-value string pairs).",
"state": fmt.Sprintf("The current lifecycle state of the gateway. %s", tfutils.FormatPossibleValues(gatewayStates...)),
}

type gatewayResource struct {
Expand Down Expand Up @@ -224,10 +221,6 @@ func (r *gatewayResource) Schema(_ context.Context, _ resource.SchemaRequest, re
ElementType: types.StringType,
Validators: validate.LabelValidators(),
},
"state": schema.StringAttribute{
Description: schemaDescriptions["state"],
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -630,9 +623,5 @@ func mapFields(ctx context.Context, gateway *vpn.GatewayResponse, model *Model,
}
model.Labels = labels

if gateway.State != nil {
model.State = types.StringValue(string(*gateway.State))
}

return nil
}
6 changes: 0 additions & 6 deletions stackit/internal/services/vpn/gateway/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestMapFields(t *testing.T) {
Tunnel1: "eu01-1",
Tunnel2: "eu01-2",
},
State: new(vpn.GatewayStatus("READY")),
},
},
expected: Model{
Expand All @@ -60,7 +59,6 @@ func TestMapFields(t *testing.T) {
},
Bgp: nil,
Labels: types.MapNull(types.StringType),
State: types.StringValue("READY"),
},
isValid: true,
},
Expand All @@ -87,7 +85,6 @@ func TestMapFields(t *testing.T) {
"env": "prod",
"team": "network",
},
State: new(vpn.GatewayStatus("READY")),
},
},
expected: Model{
Expand All @@ -113,7 +110,6 @@ func TestMapFields(t *testing.T) {
"env": types.StringValue("prod"),
"team": types.StringValue("network"),
}),
State: types.StringValue("READY"),
},
isValid: true,
},
Expand Down Expand Up @@ -141,7 +137,6 @@ func TestMapFields(t *testing.T) {
OverrideAdvertisedRoutes: []string{},
},
Labels: nil,
State: new(vpn.GatewayStatus("READY")),
},
},
expected: Model{
Expand All @@ -161,7 +156,6 @@ func TestMapFields(t *testing.T) {
OverrideAdvertisedRoutes: types.ListValueMust(types.StringType, []attr.Value{}),
},
Labels: types.MapValueMust(types.StringType, map[string]attr.Value{}),
State: types.StringValue("READY"),
},
isValid: true,
},
Expand Down
7 changes: 0 additions & 7 deletions stackit/internal/services/vpn/vpn_acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func TestAccVpnGatewayResourceMin(t *testing.T) {
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "availability_zones.tunnel1", testutil.ConvertConfigVariable(gatewayMinVars["az_tunnel1"])),
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "availability_zones.tunnel2", testutil.ConvertConfigVariable(gatewayMinVars["az_tunnel2"])),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "state"),
),
},
// Data source
Expand All @@ -123,7 +122,6 @@ func TestAccVpnGatewayResourceMin(t *testing.T) {
resource.TestCheckResourceAttr("data.stackit_vpn_gateway.gateway", "availability_zones.tunnel2", testutil.ConvertConfigVariable(gatewayMinVars["az_tunnel2"])),

resource.TestCheckResourceAttrSet("data.stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("data.stackit_vpn_gateway.gateway", "state"),

resource.TestCheckResourceAttrPair("data.stackit_vpn_gateway.gateway", "region", "stackit_vpn_gateway.gateway", "region"),
resource.TestCheckResourceAttrPair("data.stackit_vpn_gateway.gateway", "gateway_id", "stackit_vpn_gateway.gateway", "gateway_id"),
Expand All @@ -142,7 +140,6 @@ func TestAccVpnGatewayResourceMin(t *testing.T) {
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "availability_zones.tunnel1", testutil.ConvertConfigVariable(gatewayMinVarsUpdated["az_tunnel1"])),
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "availability_zones.tunnel2", testutil.ConvertConfigVariable(gatewayMinVarsUpdated["az_tunnel2"])),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "state"),
),
},
// Import
Expand Down Expand Up @@ -194,7 +191,6 @@ func TestAccVpnGatewayResourceMax(t *testing.T) {
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "bgp.override_advertised_routes.1", testutil.ConvertConfigVariable(gatewayMaxVars["advertised_route_2"])),
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "labels."+testutil.ConvertConfigVariable(gatewayMaxVars["label_key"]), testutil.ConvertConfigVariable(gatewayMaxVars["label_value"])),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "state"),
),
},
// Data source
Expand Down Expand Up @@ -225,7 +221,6 @@ func TestAccVpnGatewayResourceMax(t *testing.T) {
resource.TestCheckResourceAttr("data.stackit_vpn_gateway.gateway", "labels."+testutil.ConvertConfigVariable(gatewayMaxVars["label_key"]), testutil.ConvertConfigVariable(gatewayMaxVars["label_value"])),

resource.TestCheckResourceAttrSet("data.stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("data.stackit_vpn_gateway.gateway", "state"),

resource.TestCheckResourceAttrPair("data.stackit_vpn_gateway.gateway", "region", "stackit_vpn_gateway.gateway", "region"),
resource.TestCheckResourceAttrPair("data.stackit_vpn_gateway.gateway", "gateway_id", "stackit_vpn_gateway.gateway", "gateway_id"),
Expand All @@ -250,7 +245,6 @@ func TestAccVpnGatewayResourceMax(t *testing.T) {
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "bgp.override_advertised_routes.2", testutil.ConvertConfigVariable(gatewayMaxVarsUpdated["advertised_route_3"])),
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "labels."+testutil.ConvertConfigVariable(gatewayMaxVarsUpdated["label_key"]), testutil.ConvertConfigVariable(gatewayMaxVarsUpdated["label_value"])),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "state"),
),
},
// Update step 2 - test removal of optional fields
Expand All @@ -269,7 +263,6 @@ func TestAccVpnGatewayResourceMax(t *testing.T) {
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "bgp.override_advertised_routes.#", "0"),
resource.TestCheckResourceAttr("stackit_vpn_gateway.gateway", "labels.#", "0"),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "gateway_id"),
resource.TestCheckResourceAttrSet("stackit_vpn_gateway.gateway", "state"),
),
},
// Import
Expand Down
Loading