IaaS Release (#543)
* IaaS Volume (#541) * Onboard IaaS Volume * Labels mapping * Add acceptance test * Remove source field * Fix lint * Add examples and docs * Fix lint * Fix lint * Fix lint * Volume source field (#542) * Onboard IaaS Volume * Labels mapping * Add acceptance test * Remove source field * Fix lint * Add examples and docs * Fix lint * Fix lint * Fix lint * Add source field supoort * Fix labels and source mapping * Remove unecessary source mapping * Move methods to conversion pkg * Revert change * Update stackit/internal/services/iaas/volume/datasource.go Co-authored-by: João Palet <joao.palet@outlook.com> * Update stackit/internal/services/iaas/volume/resource.go Co-authored-by: João Palet <joao.palet@outlook.com> * Update stackit/internal/services/iaas/volume/resource.go Co-authored-by: João Palet <joao.palet@outlook.com> * Update stackit/internal/services/iaas/volume/resource.go Co-authored-by: João Palet <joao.palet@outlook.com> * Changes after review * Change after revie --------- Co-authored-by: João Palet <joao.palet@outlook.com> * Onboard IaaS security groups (#545) * onboard iaas security group * add examples and generate docs * fix linter issues * fix deletion * Update stackit/internal/services/iaas/securitygroup/resource.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * rename data source example file * update docs * remove field * remove field * remove plan modifier from the name field * refactor labels in mapFields * change function from utils to conversion * remove rules from the security group * update docs * add security group acceptance test * add plan modifiers to stateful field * sort imports * change stateful description --------- Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@stackit.cloud> Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * IaaS Server baseline configuration (#546) * Server resource schema * Implemente CRUD methods and unit testsg * Bug fixes * Bug fix * Make variable private * Remove delete_on_termination and update descriptions * Add security_group field to initial networking * Add examples and acc test * Generate docs * Fix lint * Fix lint issue * Fix unit test * Update desc * Gen docs * Onboard IaaS network interface (#544) * implement network interface * handle labels * add CIDR validation * fix linter issues and generate docs * remove computed from the allowed addresses and fix the conditions * Update stackit/internal/services/iaas/networkinterface/resource.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * Update stackit/internal/services/iaas/networkinterface/datasource.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * apply code review changes * remove status from schema * remove unnecessary GET call * Update stackit/internal/services/iaas/networkinterface/resource.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * Update stackit/internal/services/iaas/networkinterface/resource.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * rename nic_security to security * add beta markdown description * use existing validateIP function * use utils function for the options listing * refactor labels * change function from utils to conversion * make allowed addresses a list of strings * add acceptance test for network interfaces * fix acceptance test * rename security_groups as security_group_ids * extend descriptions * fix acc test --------- Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@stackit.cloud> Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * rename volume data source example (#552) Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@stackit.cloud> * add requires replace to ipv4 and ipv6 fields (#549) Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@stackit.cloud> Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * Server resource improvements (#548) * Improvements to server resource * Fix example * Remove useStateForUnknown * Update SDK modules * Update iaasalpha moduel (#555) * Remove initial networking field (#556) * Server attachment resources (#557) * Server attachemnt resources * Add examples * Update volume datasource example * Fix linting issues * Fix linting * Fix examples formatting * Update go.mod * Revert iaas to v0.11 * Onboard iaas public ip (#551) * onboard public ip * onboard public ip * add public ip acceptance test * Update examples/data-sources/stackit_public_ip/data-source.tf Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * add plan modifier to IP * change type in the volume data source * add network_interface field to public ip resource * rename network_interface to network_interface_id * remove obsolete checks * extend unit tests * add network_interface_id in example * extend unit test * extend acceptance test * sort imports --------- Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * Add labels to network, network are and network area route resources (#559) * Fix network_interface example * Extend network, network area and network area route with labels * Revert iaas to v0.11.0 --------- Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> * Onboard iaas security group rule (#553) * onboard security group rule * add security group rule to acceptance test * change type in examples * fix acc test issues * extend example with objects * remove obsolete field from acceptance test * remove unnecessary plan modifier * adapt schema fields * adapt schema fields * add requires replace to all fields * extend descriptions with protocol limitations * rename subfield protocol to number * add requires replace to objects * make icmp_parameters fields required * add empty field checks for nested objects * make max and min fields required in the port_range object * make number field computed in the protocol object * add UseStateForUnknown in protocol number * remove obsolete unit test * add checks for empty protocol and adapt unit test * add atLeastOneOf validation in protocol fields * fix linter issues * Add project existence check before deleting SNA (#561) * add project list check and error in network area deletion * Update stackit/internal/services/iaas/networkarea/resource.go Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> --------- Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * Example server use cases and other fixes (#560) * Add example usage to server resource * Update examples * Fix beta warning * Update docs and examples * Remove size from example * Fix server description, fix security group rule error message * Other fixes * remove field from datasource --------- Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> * Security group rule fixes (#562) * Add example usage to server resource * Update examples * Fix beta warning * Update docs and examples * Remove size from example * Fix server description, fix security group rule error message * Other fixes * Fixes to sec group rule * Fix lint * Change after review --------- Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> * Fix server example (#565) * Fix server example * Fixes to examples, add CIDR validation to nic * Migrate iaasalpha to iaas (#568) * Migrate iaasalpha to iaas * Fix lint * Update example * Improvements to security group rule (#569) * Improvements to security group rule * Fix lint * Fix example and remove computed from description * Fix formatting * Update description --------- Co-authored-by: João Palet <joao.palet@outlook.com> Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@stackit.cloud>
This commit is contained in:
parent
89dbf777fc
commit
93fe2fe89f
80 changed files with 10148 additions and 161 deletions
|
|
@ -31,6 +31,7 @@ data "stackit_network" "example" {
|
|||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`network_id`".
|
||||
- `ipv4_prefix_length` (Number) The IPv4 prefix length of the network.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `name` (String) The name of the network.
|
||||
- `nameservers` (List of String) The nameservers of the network.
|
||||
- `prefixes` (List of String) The prefixes of the network.
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ data "stackit_network_area" "example" {
|
|||
- `default_nameservers` (List of String) List of DNS Servers/Nameservers.
|
||||
- `default_prefix_length` (Number) The default prefix length for networks in the network area.
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`organization_id`,`network_area_id`".
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `max_prefix_length` (Number) The maximal prefix length for networks in the network area.
|
||||
- `min_prefix_length` (Number) The minimal prefix length for networks in the network area.
|
||||
- `name` (String) The name of the network area.
|
||||
|
|
|
|||
|
|
@ -35,5 +35,6 @@ data "stackit_network_area_route" "example" {
|
|||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal data source ID. It is structured as "`organization_id`,`network_area_id`,`network_area_route_id`".
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `next_hop` (String) The IP address of the routing system, that will route the prefix configured. Should be a valid IPv4 address.
|
||||
- `prefix` (String) The network, that is reachable though the Next Hop. Should use CIDR notation.
|
||||
|
|
|
|||
46
docs/data-sources/network_interface.md
Normal file
46
docs/data-sources/network_interface.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_network_interface Data Source - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Network interface datasource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_network_interface (Data Source)
|
||||
|
||||
Network interface datasource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "stackit_network_interface" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `network_id` (String) The network ID to which the network interface is associated.
|
||||
- `network_interface_id` (String) The network interface ID.
|
||||
- `project_id` (String) STACKIT project ID to which the network interface is associated.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `allowed_addresses` (List of String) The list of CIDR (Classless Inter-Domain Routing) notations.
|
||||
- `device` (String) The device UUID of the network interface.
|
||||
- `id` (String) Terraform's internal data source ID. It is structured as "`project_id`,`network_id`,`network_interface_id`".
|
||||
- `ipv4` (String) The IPv4 address.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a network interface.
|
||||
- `mac` (String) The MAC address of network interface.
|
||||
- `name` (String) The name of the network interface.
|
||||
- `security` (Boolean) The Network Interface Security. If set to false, then no security groups will apply to this network interface.
|
||||
- `security_group_ids` (List of String) The list of security group UUIDs. If security is set to false, setting this field will lead to an error.
|
||||
- `type` (String) Type of network interface. Some of the possible values are: Supported values are: `server`, `metadata`, `gateway`.
|
||||
38
docs/data-sources/public_ip.md
Normal file
38
docs/data-sources/public_ip.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_public_ip Data Source - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Volume resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_public_ip (Data Source)
|
||||
|
||||
Volume resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "stackit_public_ip" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the public IP is associated.
|
||||
- `public_ip_id` (String) The public IP ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal datasource ID. It is structured as "`project_id`,`public_ip_id`".
|
||||
- `ip` (String) The IP address.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `network_interface_id` (String) Associates the public IP with a network interface or a virtual IP (ID).
|
||||
39
docs/data-sources/security_group.md
Normal file
39
docs/data-sources/security_group.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_security_group Data Source - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Security group datasource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_security_group (Data Source)
|
||||
|
||||
Security group datasource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "stackit_security_group" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the security group is associated.
|
||||
- `security_group_id` (String) The security group ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `description` (String) The description of the security group.
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`security_group_id`".
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `name` (String) The name of the security group.
|
||||
- `stateful` (Boolean) Configures if a security group is stateful or stateless. There can only be one type of security groups per network interface/server.
|
||||
71
docs/data-sources/security_group_rule.md
Normal file
71
docs/data-sources/security_group_rule.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_security_group_rule Data Source - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Security group datasource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_security_group_rule (Data Source)
|
||||
|
||||
Security group datasource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "stackit_security_group_rule" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
security_group_rule_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the security group rule is associated.
|
||||
- `security_group_id` (String) The security group ID.
|
||||
- `security_group_rule_id` (String) The security group rule ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `description` (String) The description of the security group rule.
|
||||
- `direction` (String) The direction of the traffic which the rule should match. Some of the possible values are: Supported values are: `ingress`, `egress`.
|
||||
- `ether_type` (String) The ethertype which the rule should match.
|
||||
- `icmp_parameters` (Attributes) ICMP Parameters. (see [below for nested schema](#nestedatt--icmp_parameters))
|
||||
- `id` (String) Terraform's internal datasource ID. It is structured as "`project_id`,`security_group_id`,`security_group_rule_id`".
|
||||
- `ip_range` (String) The remote IP range which the rule should match.
|
||||
- `port_range` (Attributes) The range of ports. (see [below for nested schema](#nestedatt--port_range))
|
||||
- `protocol` (Attributes) The internet protocol which the rule should match. (see [below for nested schema](#nestedatt--protocol))
|
||||
- `remote_security_group_id` (String) The remote security group which the rule should match.
|
||||
|
||||
<a id="nestedatt--icmp_parameters"></a>
|
||||
### Nested Schema for `icmp_parameters`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `code` (Number) ICMP code. Can be set if the protocol is ICMP.
|
||||
- `type` (Number) ICMP type. Can be set if the protocol is ICMP.
|
||||
|
||||
|
||||
<a id="nestedatt--port_range"></a>
|
||||
### Nested Schema for `port_range`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `max` (Number) The maximum port number. Should be greater or equal to the minimum.
|
||||
- `min` (Number) The minimum port number. Should be less or equal to the minimum.
|
||||
|
||||
|
||||
<a id="nestedatt--protocol"></a>
|
||||
### Nested Schema for `protocol`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `name` (String) The protocol name which the rule should match.
|
||||
- `number` (Number) The protocol number which the rule should match.
|
||||
50
docs/data-sources/server.md
Normal file
50
docs/data-sources/server.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_server Data Source - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Server datasource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_server (Data Source)
|
||||
|
||||
Server datasource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the server is associated.
|
||||
- `server_id` (String) The server ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `affinity_group` (String) The affinity group the server is assigned to.
|
||||
- `availability_zone` (String) The availability zone of the server.
|
||||
- `boot_volume` (Attributes) The boot volume for the server (see [below for nested schema](#nestedatt--boot_volume))
|
||||
- `created_at` (String) Date-time when the server was created
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`".
|
||||
- `image_id` (String) The image ID to be used for an ephemeral disk on the server.
|
||||
- `keypair_name` (String) The name of the keypair used during server creation.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `launched_at` (String) Date-time when the server was launched
|
||||
- `machine_type` (String) Name of the type of the machine for the server. Possible values are documented in [Virtual machine flavors](https://docs.stackit.cloud/stackit/en/virtual-machine-flavors-75137231.html)
|
||||
- `name` (String) The name of the server.
|
||||
- `updated_at` (String) Date-time when the server was updated
|
||||
- `user_data` (String) User data that is passed via cloud-init to the server.
|
||||
|
||||
<a id="nestedatt--boot_volume"></a>
|
||||
### Nested Schema for `boot_volume`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `id` (String) The ID of the source, either image ID or volume ID
|
||||
- `performance_class` (String) The performance class of the server.
|
||||
- `size` (Number) The size of the boot volume in GB.
|
||||
- `type` (String) The type of the source. Supported values are: `volume`, `image`.
|
||||
51
docs/data-sources/volume.md
Normal file
51
docs/data-sources/volume.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_volume Data Source - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Volume resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_volume (Data Source)
|
||||
|
||||
Volume resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "stackit_volume" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the volume is associated.
|
||||
- `volume_id` (String) The volume ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `availability_zone` (String) The availability zone of the volume.
|
||||
- `description` (String) The description of the volume.
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`volume_id`".
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `name` (String) The name of the volume.
|
||||
- `performance_class` (String) The performance class of the volume.
|
||||
- `server_id` (String) The server ID of the server to which the volume is attached to.
|
||||
- `size` (Number) The size of the volume in GB. It can only be updated to a larger value than the current size
|
||||
- `source` (Attributes) The source of the volume. It can be either a volume, an image, a snapshot or a backup (see [below for nested schema](#nestedatt--source))
|
||||
|
||||
<a id="nestedatt--source"></a>
|
||||
### Nested Schema for `source`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `id` (String) The ID of the source, e.g. image ID
|
||||
- `type` (String) The type of the source. Supported values are: `volume`, `image`, `snapshot`, `backup`.
|
||||
|
|
@ -8,23 +8,25 @@ description: |-
|
|||
To automate the creation of load balancers, OpenStack can be used to setup the supporting infrastructure.
|
||||
To set up the OpenStack provider, you can create a token through the STACKIT Portal, in your project's Infrastructure API page.
|
||||
There, the OpenStack user domain name, username, and password are generated and can be obtained. The provider can then be configured as follows:
|
||||
```terraform
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
(...)
|
||||
openstack = {
|
||||
source = "terraform-provider-openstack/openstack"
|
||||
}
|
||||
}
|
||||
required_providers {
|
||||
(...)
|
||||
openstack = {
|
||||
source = "terraform-provider-openstack/openstack"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "openstack" {
|
||||
user_domain_name = "{OpenStack user domain name}"
|
||||
user_name = "{OpenStack username}"
|
||||
password = "{OpenStack password}"
|
||||
region = "RegionOne"
|
||||
auth_url = "https://keystone.api.iaas.eu01.stackit.cloud/v3"
|
||||
user_domain_name = "{OpenStack user domain name}"
|
||||
user_name = "{OpenStack username}"
|
||||
password = "{OpenStack password}"
|
||||
region = "RegionOne"
|
||||
auth_url = "https://keystone.api.iaas.eu01.stackit.cloud/v3"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Configuring the supporting infrastructure
|
||||
The example below uses OpenStack to create the network, router, a public IP address and a compute instance.
|
||||
---
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ resource "stackit_network" "example" {
|
|||
name = "example-network"
|
||||
nameservers = ["1.2.3.4", "5.6.7.8"]
|
||||
ipv4_prefix_length = 24
|
||||
labels = {
|
||||
"key" = "value"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -32,6 +35,7 @@ resource "stackit_network" "example" {
|
|||
### Optional
|
||||
|
||||
- `ipv4_prefix_length` (Number) The IPv4 prefix length of the network.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `nameservers` (List of String) The nameservers of the network.
|
||||
|
||||
### Read-Only
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@ page_title: "stackit_network_area Resource - stackit"
|
|||
subcategory: ""
|
||||
description: |-
|
||||
Network area resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_network_area (Resource)
|
||||
|
||||
Network area resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
|
|
@ -18,10 +21,13 @@ resource "stackit_network_area" "example" {
|
|||
name = "example-network-area"
|
||||
network_ranges = [
|
||||
{
|
||||
prefix = "1.2.3.4"
|
||||
prefix = "192.168.0.0/24"
|
||||
}
|
||||
]
|
||||
transfer_network = "1.2.3.4/5"
|
||||
transfer_network = "192.168.0.0/24"
|
||||
labels = {
|
||||
"key" = "value"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -39,14 +45,13 @@ resource "stackit_network_area" "example" {
|
|||
|
||||
- `default_nameservers` (List of String) List of DNS Servers/Nameservers.
|
||||
- `default_prefix_length` (Number) The default prefix length for networks in the network area.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `max_prefix_length` (Number) The maximal prefix length for networks in the network area.
|
||||
- `min_prefix_length` (Number) The minimal prefix length for networks in the network area.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Network area resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`organization_id`,`network_area_id`".
|
||||
- `network_area_id` (String) The network area ID.
|
||||
- `project_count` (Number) The amount of projects currently referencing this area.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,20 +4,26 @@ page_title: "stackit_network_area_route Resource - stackit"
|
|||
subcategory: ""
|
||||
description: |-
|
||||
Network area route resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_network_area_route (Resource)
|
||||
|
||||
Network area route resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_network_area" "example" {
|
||||
resource "stackit_network_area_route" "example" {
|
||||
organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
prefix = "1.2.3.4/5"
|
||||
next_hop = "6.7.8.9"
|
||||
prefix = "192.168.0.0/24"
|
||||
next_hop = "192.168.0.0"
|
||||
labels = {
|
||||
"key" = "value"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -31,9 +37,11 @@ resource "stackit_network_area" "example" {
|
|||
- `organization_id` (String) STACKIT organization ID to which the network area is associated.
|
||||
- `prefix` (String) The network, that is reachable though the Next Hop. Should use CIDR notation.
|
||||
|
||||
### Optional
|
||||
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Network area route resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`organization_id`,`network_area_id`,`network_area_route_id`".
|
||||
- `network_area_route_id` (String) The network area route ID.
|
||||
|
|
|
|||
50
docs/resources/network_interface.md
Normal file
50
docs/resources/network_interface.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_network_interface Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Network interface resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_network_interface (Resource)
|
||||
|
||||
Network interface resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_network_interface" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
allowed_addresses = ["192.168.0.0/24"]
|
||||
security_group_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `network_id` (String) The network ID to which the network interface is associated.
|
||||
- `project_id` (String) STACKIT project ID to which the network is associated.
|
||||
|
||||
### Optional
|
||||
|
||||
- `allowed_addresses` (List of String) The list of CIDR (Classless Inter-Domain Routing) notations.
|
||||
- `ipv4` (String) The IPv4 address.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a network interface.
|
||||
- `name` (String) The name of the network interface.
|
||||
- `security` (Boolean) The Network Interface Security. If set to false, then no security groups will apply to this network interface.
|
||||
- `security_group_ids` (List of String) The list of security group UUIDs. If security is set to false, setting this field will lead to an error.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `device` (String) The device UUID of the network interface.
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`network_id`,`network_interface_id`".
|
||||
- `mac` (String) The MAC address of network interface.
|
||||
- `network_interface_id` (String) The network interface ID.
|
||||
- `type` (String) Type of network interface. Some of the possible values are: Supported values are: `server`, `metadata`, `gateway`.
|
||||
44
docs/resources/public_ip.md
Normal file
44
docs/resources/public_ip.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_public_ip Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Public IP resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_public_ip (Resource)
|
||||
|
||||
Public IP resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_public_ip" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
labels = {
|
||||
"key" = "value"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the public IP is associated.
|
||||
|
||||
### Optional
|
||||
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `network_interface_id` (String) Associates the public IP with a network interface or a virtual IP (ID).
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`public_ip_id`".
|
||||
- `ip` (String) The IP address.
|
||||
- `public_ip_id` (String) The public IP ID.
|
||||
45
docs/resources/security_group.md
Normal file
45
docs/resources/security_group.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_security_group Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Security group resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_security_group (Resource)
|
||||
|
||||
Security group resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_security_group" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "my_security_group"
|
||||
labels = {
|
||||
"key" = "value"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `name` (String) The name of the security group.
|
||||
- `project_id` (String) STACKIT project ID to which the security group is associated.
|
||||
|
||||
### Optional
|
||||
|
||||
- `description` (String) The description of the security group.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `stateful` (Boolean) Configures if a security group is stateful or stateless. There can only be one type of security groups per network interface/server.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`security_group_id`".
|
||||
- `security_group_id` (String) The security group ID.
|
||||
81
docs/resources/security_group_rule.md
Normal file
81
docs/resources/security_group_rule.md
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_security_group_rule Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Security group rule resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_security_group_rule (Resource)
|
||||
|
||||
Security group rule resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_security_group_rule" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
direction = "ingress"
|
||||
icmp_parameters = {
|
||||
code = 0
|
||||
type = 8
|
||||
}
|
||||
protocol = {
|
||||
name = "icmp"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `direction` (String) The direction of the traffic which the rule should match. Some of the possible values are: Supported values are: `ingress`, `egress`.
|
||||
- `project_id` (String) STACKIT project ID to which the security group rule is associated.
|
||||
- `security_group_id` (String) The security group ID.
|
||||
|
||||
### Optional
|
||||
|
||||
- `description` (String) The rule description.
|
||||
- `ether_type` (String) The ethertype which the rule should match.
|
||||
- `icmp_parameters` (Attributes) ICMP Parameters. These parameters should only be provided if the protocol is ICMP. (see [below for nested schema](#nestedatt--icmp_parameters))
|
||||
- `ip_range` (String) The remote IP range which the rule should match.
|
||||
- `port_range` (Attributes) The range of ports. This should only be provided if the protocol is not ICMP. (see [below for nested schema](#nestedatt--port_range))
|
||||
- `protocol` (Attributes) The internet protocol which the rule should match. (see [below for nested schema](#nestedatt--protocol))
|
||||
- `remote_security_group_id` (String) The remote security group which the rule should match.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`security_group_id`,`security_group_rule_id`".
|
||||
- `security_group_rule_id` (String) The security group rule ID.
|
||||
|
||||
<a id="nestedatt--icmp_parameters"></a>
|
||||
### Nested Schema for `icmp_parameters`
|
||||
|
||||
Required:
|
||||
|
||||
- `code` (Number) ICMP code. Can be set if the protocol is ICMP.
|
||||
- `type` (Number) ICMP type. Can be set if the protocol is ICMP.
|
||||
|
||||
|
||||
<a id="nestedatt--port_range"></a>
|
||||
### Nested Schema for `port_range`
|
||||
|
||||
Required:
|
||||
|
||||
- `max` (Number) The maximum port number. Should be greater or equal to the minimum.
|
||||
- `min` (Number) The minimum port number. Should be less or equal to the maximum.
|
||||
|
||||
|
||||
<a id="nestedatt--protocol"></a>
|
||||
### Nested Schema for `protocol`
|
||||
|
||||
Optional:
|
||||
|
||||
- `name` (String) The protocol name which the rule should match. Either `name` or `number` must be provided.
|
||||
- `number` (Number) The protocol number which the rule should match. Either `name` or `number` must be provided.
|
||||
374
docs/resources/server.md
Normal file
374
docs/resources/server.md
Normal file
|
|
@ -0,0 +1,374 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_server Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Server resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
Example Usage
|
||||
Boot from volume
|
||||
|
||||
resource "stackit_server" "boot-from-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
|
||||
Boot from existing volume
|
||||
|
||||
resource "stackit_volume" "example-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
size = 12
|
||||
source = {
|
||||
type = "image"
|
||||
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-volume"
|
||||
availability_zone = "eu01-1"
|
||||
}
|
||||
|
||||
resource "stackit_server" "boot-from-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
source_type = "volume"
|
||||
source_id = stackit_volume.example-volume.volume_id
|
||||
}
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
|
||||
Network setup
|
||||
|
||||
resource "stackit_server" "server-with-network" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
resource "stackit_network" "network" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-network"
|
||||
nameservers = ["192.0.2.0", "198.51.100.0", "203.0.113.0"]
|
||||
ipv4_prefix_length = 24
|
||||
}
|
||||
|
||||
resource "stackit_security_group" "sec-group" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-security-group"
|
||||
stateful = true
|
||||
}
|
||||
|
||||
resource "stackit_security_group_rule" "rule" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
security_group_id = stackit_security_group.sec-group.security_group_id
|
||||
direction = "ingress"
|
||||
ether_type = "IPv4"
|
||||
}
|
||||
|
||||
resource "stackit_network_interface" "nic" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_id = stackit_network.network.network_id
|
||||
security_group_ids = [stackit_security_group.sec-group.security_group_id]
|
||||
}
|
||||
|
||||
resource "stackit_public_ip" "public-ip" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_interface_id = stackit_network_interface.nic.network_interface_id
|
||||
}
|
||||
|
||||
resource "stackit_server_network_interface_attach" "nic-attachment" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = stackit_server.server-with-network.server_id
|
||||
network_interface_id = stackit_network_interface.nic.network_interface_id
|
||||
}
|
||||
|
||||
|
||||
Server with attached volume
|
||||
|
||||
resource "stackit_volume" "example-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
size = 12
|
||||
source = {
|
||||
type = "image"
|
||||
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-volume"
|
||||
availability_zone = "eu01-1"
|
||||
}
|
||||
|
||||
resource "stackit_server" "server-with-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
resource "stackit_server_volume_attach" "attach_volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = stackit_server.server-with-volume.server_id
|
||||
volume_id = stackit_volume.example-volume.volume_id
|
||||
}
|
||||
|
||||
|
||||
Server with user data (cloud-init)
|
||||
|
||||
resource "stackit_server" "user-data" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-server"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
user_data = "#!/bin/bash\n/bin/su"
|
||||
}
|
||||
|
||||
resource "stackit_server" "user-data-from-file" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-server"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
user_data = file("${path.module}/cloud-init.yaml")
|
||||
}
|
||||
---
|
||||
|
||||
# stackit_server (Resource)
|
||||
|
||||
Server resource schema. Must have a region specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
## Example Usage
|
||||
|
||||
|
||||
### Boot from volume
|
||||
```terraform
|
||||
resource "stackit_server" "boot-from-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Boot from existing volume
|
||||
```terraform
|
||||
resource "stackit_volume" "example-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
size = 12
|
||||
source = {
|
||||
type = "image"
|
||||
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-volume"
|
||||
availability_zone = "eu01-1"
|
||||
}
|
||||
|
||||
resource "stackit_server" "boot-from-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
source_type = "volume"
|
||||
source_id = stackit_volume.example-volume.volume_id
|
||||
}
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Network setup
|
||||
```terraform
|
||||
resource "stackit_server" "server-with-network" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
resource "stackit_network" "network" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-network"
|
||||
nameservers = ["192.0.2.0", "198.51.100.0", "203.0.113.0"]
|
||||
ipv4_prefix_length = 24
|
||||
}
|
||||
|
||||
resource "stackit_security_group" "sec-group" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-security-group"
|
||||
stateful = true
|
||||
}
|
||||
|
||||
resource "stackit_security_group_rule" "rule" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
security_group_id = stackit_security_group.sec-group.security_group_id
|
||||
direction = "ingress"
|
||||
ether_type = "IPv4"
|
||||
}
|
||||
|
||||
resource "stackit_network_interface" "nic" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_id = stackit_network.network.network_id
|
||||
security_group_ids = [stackit_security_group.sec-group.security_group_id]
|
||||
}
|
||||
|
||||
resource "stackit_public_ip" "public-ip" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_interface_id = stackit_network_interface.nic.network_interface_id
|
||||
}
|
||||
|
||||
resource "stackit_server_network_interface_attach" "nic-attachment" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = stackit_server.server-with-network.server_id
|
||||
network_interface_id = stackit_network_interface.nic.network_interface_id
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Server with attached volume
|
||||
```terraform
|
||||
resource "stackit_volume" "example-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
size = 12
|
||||
source = {
|
||||
type = "image"
|
||||
id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-volume"
|
||||
availability_zone = "eu01-1"
|
||||
}
|
||||
|
||||
resource "stackit_server" "server-with-volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
}
|
||||
|
||||
resource "stackit_server_volume_attach" "attach_volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = stackit_server.server-with-volume.server_id
|
||||
volume_id = stackit_volume.example-volume.volume_id
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Server with user data (cloud-init)
|
||||
```terraform
|
||||
resource "stackit_server" "user-data" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-server"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
user_data = "#!/bin/bash\n/bin/su"
|
||||
}
|
||||
|
||||
resource "stackit_server" "user-data-from-file" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
name = "example-server"
|
||||
machine_type = "g1.1"
|
||||
keypair_name = "example-keypair"
|
||||
user_data = file("${path.module}/cloud-init.yaml")
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `machine_type` (String) Name of the type of the machine for the server. Possible values are documented in [Virtual machine flavors](https://docs.stackit.cloud/stackit/en/virtual-machine-flavors-75137231.html)
|
||||
- `name` (String) The name of the server.
|
||||
- `project_id` (String) STACKIT project ID to which the server is associated.
|
||||
|
||||
### Optional
|
||||
|
||||
- `affinity_group` (String) The affinity group the server is assigned to.
|
||||
- `availability_zone` (String) The availability zone of the server.
|
||||
- `boot_volume` (Attributes) The boot volume for the server (see [below for nested schema](#nestedatt--boot_volume))
|
||||
- `image_id` (String) The image ID to be used for an ephemeral disk on the server.
|
||||
- `keypair_name` (String) The name of the keypair used during server creation.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `user_data` (String) User data that is passed via cloud-init to the server.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `created_at` (String) Date-time when the server was created
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`".
|
||||
- `launched_at` (String) Date-time when the server was launched
|
||||
- `server_id` (String) The server ID.
|
||||
- `updated_at` (String) Date-time when the server was updated
|
||||
|
||||
<a id="nestedatt--boot_volume"></a>
|
||||
### Nested Schema for `boot_volume`
|
||||
|
||||
Required:
|
||||
|
||||
- `source_id` (String) The ID of the source, either image ID or volume ID
|
||||
- `source_type` (String) The type of the source. Supported values are: `volume`, `image`.
|
||||
|
||||
Optional:
|
||||
|
||||
- `performance_class` (String) The performance class of the server.
|
||||
- `size` (Number) The size of the boot volume in GB. Must be provided when `source_type` is `image`.
|
||||
37
docs/resources/server_network_interface_attach.md
Normal file
37
docs/resources/server_network_interface_attach.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_server_network_interface_attach Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Network interface attachment resource schema. Attaches a network interface to a server. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_server_network_interface_attach (Resource)
|
||||
|
||||
Network interface attachment resource schema. Attaches a network interface to a server. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_server_network_interface_attach" "attached_network_interface" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `network_interface_id` (String) The network interface ID.
|
||||
- `project_id` (String) STACKIT project ID to which the network interface attachment is associated.
|
||||
- `server_id` (String) The server ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`,`network_interface_id`".
|
||||
37
docs/resources/server_service_account_attach.md
Normal file
37
docs/resources/server_service_account_attach.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_server_service_account_attach Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Service account attachment resource schema. Attaches a service account to a server. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_server_service_account_attach (Resource)
|
||||
|
||||
Service account attachment resource schema. Attaches a service account to a server. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_server_service_account_attach" "attached_service_account" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
service_account_email = "service-account@stackit.cloud"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the service account attachment is associated.
|
||||
- `server_id` (String) The server ID.
|
||||
- `service_account_email` (String) The service account email.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`,`service_account_email`".
|
||||
37
docs/resources/server_volume_attach.md
Normal file
37
docs/resources/server_volume_attach.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_server_volume_attach Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Volume attachment resource schema. Attaches a volume to a server. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_server_volume_attach (Resource)
|
||||
|
||||
Volume attachment resource schema. Attaches a volume to a server. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_server_volume_attach" "attached_volume" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `project_id` (String) STACKIT project ID to which the volume attachment is associated.
|
||||
- `server_id` (String) The server ID.
|
||||
- `volume_id` (String) The volume ID.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`,`volume_id`".
|
||||
|
|
@ -3,12 +3,12 @@
|
|||
page_title: "stackit_sqlserverflex_user Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
[Warning: BETA] SQLServer Flex user resource schema. Must have a region specified in the provider configuration.
|
||||
SQLServer Flex user resource schema. Must have a region specified in the provider configuration.
|
||||
---
|
||||
|
||||
# stackit_sqlserverflex_user (Resource)
|
||||
|
||||
[Warning: BETA] SQLServer Flex user resource schema. Must have a `region` specified in the provider configuration.
|
||||
SQLServer Flex user resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
## Example Usage
|
||||
|
||||
|
|
|
|||
59
docs/resources/volume.md
Normal file
59
docs/resources/volume.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_volume Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Volume resource schema. Must have a region specified in the provider configuration.
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
|
||||
---
|
||||
|
||||
# stackit_volume (Resource)
|
||||
|
||||
Volume resource schema. Must have a `region` specified in the provider configuration.
|
||||
|
||||
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_volume" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "my_volume"
|
||||
availability_zone = "eu01-1"
|
||||
size = 64
|
||||
labels = {
|
||||
"key" = "value"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `availability_zone` (String) The availability zone of the volume.
|
||||
- `project_id` (String) STACKIT project ID to which the volume is associated.
|
||||
|
||||
### Optional
|
||||
|
||||
- `description` (String) The description of the volume.
|
||||
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
|
||||
- `name` (String) The name of the volume.
|
||||
- `performance_class` (String) The performance class of the volume.
|
||||
- `server_id` (String) The server ID of the server to which the volume is attached to.
|
||||
- `size` (Number) The size of the volume in GB. It can only be updated to a larger value than the current size. Either `size` or `source` must be provided
|
||||
- `source` (Attributes) The source of the volume. It can be either a volume, an image, a snapshot or a backup. Either `size` or `source` must be provided (see [below for nested schema](#nestedatt--source))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`volume_id`".
|
||||
- `volume_id` (String) The volume ID.
|
||||
|
||||
<a id="nestedatt--source"></a>
|
||||
### Nested Schema for `source`
|
||||
|
||||
Required:
|
||||
|
||||
- `id` (String) The ID of the source, e.g. image ID
|
||||
- `type` (String) The type of the source. Supported values are: `volume`, `image`, `snapshot`, `backup`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue