Skip to content

Commit 29cbe25

Browse files
committed
add examples
1 parent 2fc9e7f commit 29cbe25

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

docs/data-sources/network_area_region.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ description: |-
1010

1111
Network area region data source schema.
1212

13-
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_network_area_region" "example" {
17+
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
}
20+
```
1421

1522
<!-- schema generated by tfplugindocs -->
1623
## Schema

docs/resources/network_area_region.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,28 @@ description: |-
1010

1111
Network area region resource schema.
1212

13-
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_network_area_region" "example" {
17+
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
ipv4 = {
20+
transfer_network = "10.1.2.0/24"
21+
network_ranges = [
22+
{
23+
prefix = "10.0.0.0/16"
24+
}
25+
]
26+
}
27+
}
28+
29+
# Only use the import statement, if you want to import an existing network area region
30+
import {
31+
to = stackit_network_area_region.import-example
32+
id = "${var.organization_id},${var.network_area_id},eu01"
33+
}
34+
```
1435

1536
<!-- schema generated by tfplugindocs -->
1637
## Schema
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "stackit_network_area_region" "example" {
2+
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
resource "stackit_network_area_region" "example" {
2+
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
ipv4 = {
5+
transfer_network = "10.1.2.0/24"
6+
network_ranges = [
7+
{
8+
prefix = "10.0.0.0/16"
9+
}
10+
]
11+
}
12+
}
13+
14+
# Only use the import statement, if you want to import an existing network area region
15+
import {
16+
to = stackit_network_area_region.import-example
17+
id = "${var.organization_id},${var.network_area_id},eu01"
18+
}

examples/resources/stackit_network_area_route/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ resource "stackit_network_area_route" "example" {
1212
import {
1313
to = stackit_network_area_route.import-example
1414
id = "${var.organization_id},${var.network_area_id},${var.network_area_route_id}"
15-
}
15+
}

stackit/internal/services/iaas/networkarearoute/resource.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,7 @@ func toCreatePayload(ctx context.Context, model *Model) (*iaas.CreateNetworkArea
462462
{
463463
Destination: &iaas.RouteDestination{
464464
DestinationCIDRv4: &iaas.DestinationCIDRv4{
465-
Type: sdkUtils.Ptr("cidrv4"),
466-
// TODO: "prefix" was renamed to "destination" on API side
467-
// TODO: allow all configurations, not only IPv4
465+
Type: sdkUtils.Ptr("cidrv4"),
468466
Value: conversion.StringValueToPointer(model.Prefix),
469467
},
470468
DestinationCIDRv6: nil,

0 commit comments

Comments
 (0)