Skip to content

Commit 8248640

Browse files
feat(edgecloud): add resources and data sources for the edgecloud service (#1119)
1 parent 617417c commit 8248640

File tree

31 files changed

+3536
-0
lines changed

31 files changed

+3536
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_edgecloud_instances Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Edge Cloud is in private Beta and not generally available.
7+
You can contact support if you are interested in trying it out.
8+
~> This datasource 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.
9+
---
10+
11+
# stackit_edgecloud_instances (Data Source)
12+
13+
Edge Cloud is in private Beta and not generally available.
14+
You can contact support if you are interested in trying it out.
15+
16+
~> This datasource 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.
17+
18+
## Example Usage
19+
20+
```terraform
21+
# returns all Edge Cloud instances created in the given project which are inside the provider default_region
22+
data "stackit_edgecloud_instances" "plan_id" {
23+
project_id = var.project_id
24+
}
25+
26+
# returns all Edge Cloud instances created in the given project in the given region
27+
data "stackit_edgecloud_instances" "plan_id" {
28+
project_id = var.project_id
29+
region = var.region
30+
}
31+
```
32+
33+
<!-- schema generated by tfplugindocs -->
34+
## Schema
35+
36+
### Required
37+
38+
- `project_id` (String) STACKIT project ID to which the Edge Cloud instances are associated.
39+
40+
### Optional
41+
42+
- `region` (String) The resource region. If not defined, the provider region is used.
43+
44+
### Read-Only
45+
46+
- `id` (String) Terraform's internal data source ID, structured as `project_id`,`region`.
47+
- `instances` (Attributes List) A list of Edge Cloud instances. (see [below for nested schema](#nestedatt--instances))
48+
49+
<a id="nestedatt--instances"></a>
50+
### Nested Schema for `instances`
51+
52+
Read-Only:
53+
54+
- `created` (String) The date and time the instance was created.
55+
- `description` (String) Description of the instance.
56+
- `display_name` (String) The display name of the instance.
57+
- `frontend_url` (String) Frontend URL for the Edge Cloud instance.
58+
- `instance_id` (String) The ID of the instance.
59+
- `plan_id` (String) The plan ID for the instance.
60+
- `region` (String) The region where the instance is located.
61+
- `status` (String) The status of the instance.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_edgecloud_plans Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Edge Cloud is in private Beta and not generally available.
7+
You can contact support if you are interested in trying it out.
8+
~> This datasource 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.
9+
---
10+
11+
# stackit_edgecloud_plans (Data Source)
12+
13+
Edge Cloud is in private Beta and not generally available.
14+
You can contact support if you are interested in trying it out.
15+
16+
~> This datasource 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.
17+
18+
## Example Usage
19+
20+
```terraform
21+
data "stackit_edgecloud_plans" "this" {
22+
project_id = var.project_id
23+
}
24+
```
25+
26+
<!-- schema generated by tfplugindocs -->
27+
## Schema
28+
29+
### Required
30+
31+
- `project_id` (String) STACKIT project ID the Plans belongs to.
32+
33+
### Read-Only
34+
35+
- `id` (String) Terraform's internal data source ID, `project_id` is used here.
36+
- `plans` (Attributes List) A list of Edge Cloud Plans. (see [below for nested schema](#nestedatt--plans))
37+
38+
<a id="nestedatt--plans"></a>
39+
### Nested Schema for `plans`
40+
41+
Read-Only:
42+
43+
- `description` (String) Description of the plan.
44+
- `id` (String) The ID of the plan.
45+
- `max_edge_hosts` (Number) Maximum number of Edge Cloud hosts that can be used.
46+
- `name` (String) The name of the plan.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
158158
- `credentials_path` (String) Path of JSON from where the credentials are read. Takes precedence over the env var `STACKIT_CREDENTIALS_PATH`. Default value is `~/.stackit/credentials.json`.
159159
- `default_region` (String) Region will be used as the default location for regional services. Not all services require a region, some are global
160160
- `dns_custom_endpoint` (String) Custom endpoint for the DNS service
161+
- `edgecloud_custom_endpoint` (String) Custom endpoint for the Edge Cloud service
161162
- `enable_beta_resources` (Boolean) Enable beta resources. Default is false.
162163
- `experiments` (List of String) Enables experiments. These are unstable features without official support. More information can be found in the README. Available Experiments: iam, routing-tables, network
163164
- `git_custom_endpoint` (String) Custom endpoint for the Git service
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_edgecloud_instance Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Edge Cloud is in private Beta and not generally available.
7+
You can contact support if you are interested in trying it out.
8+
~> 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.
9+
---
10+
11+
# stackit_edgecloud_instance (Resource)
12+
13+
Edge Cloud is in private Beta and not generally available.
14+
You can contact support if you are interested in trying it out.
15+
16+
~> 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.
17+
18+
## Example Usage
19+
20+
```terraform
21+
locals {
22+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
23+
display_name = "edge"
24+
plan_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
25+
description = "cats live on the edge"
26+
region = "eu01"
27+
}
28+
29+
resource "stackit_edgecloud_instance" "this" {
30+
project_id = local.project_id
31+
display_name = local.display_name
32+
plan_id = local.plan_id
33+
description = local.description
34+
}
35+
36+
# Only use the import statement, if you want to import an existing Edge Cloud instance resource
37+
import {
38+
to = stackit_edgecloud_instance.this
39+
id = "${local.project_id},${local.region},INSTANCE_ID"
40+
}
41+
```
42+
43+
<!-- schema generated by tfplugindocs -->
44+
## Schema
45+
46+
### Required
47+
48+
- `display_name` (String) Display name shown for the Edge Cloud instance. Has to be a valid hostname, with a length between 4 and 8 characters.
49+
- `plan_id` (String) STACKIT Edge Plan ID for the Edge Cloud instance, has to be the UUID of an existing plan.
50+
- `project_id` (String) STACKIT project ID to which the Edge Cloud instance is associated.
51+
52+
### Optional
53+
54+
- `description` (String) Description for your STACKIT Edge Cloud instance. Max length is 256 characters
55+
- `region` (String) STACKIT region to use for the instance, providers default_region will be used if unset.
56+
57+
### Read-Only
58+
59+
- `created` (String) The date and time the creation of the instance was triggered.
60+
- `frontend_url` (String) Frontend URL for the Edge Cloud instance.
61+
- `id` (String) Terraform's internal resource ID, structured as "`project_id`,`region`,`instance_id`".
62+
- `instance_id` (String) <displayName>-<projectIDHash>
63+
- `status` (String) instance status
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_edgecloud_kubeconfig Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Edge Cloud is in private Beta and not generally available.
7+
You can contact support if you are interested in trying it out.
8+
~> 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.
9+
---
10+
11+
# stackit_edgecloud_kubeconfig (Resource)
12+
13+
Edge Cloud is in private Beta and not generally available.
14+
You can contact support if you are interested in trying it out.
15+
16+
~> 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.
17+
18+
## Example Usage
19+
20+
```terraform
21+
# the instance resource only exists here to illustrate the usage of it's attribute
22+
resource "stackit_edgecloud_instance" "this" {
23+
project_id = local.project_id
24+
display_name = "example"
25+
plan_id = var.plan_id
26+
description = "some_description"
27+
}
28+
29+
resource "stackit_edgecloud_kubeconfig" "by_name" {
30+
project_id = var.project_id
31+
instance_name = stackit_edgecloud_instance.this.display_name
32+
expiration = 3600 # seconds
33+
}
34+
35+
resource "stackit_edgecloud_kubeconfig" "by_id" {
36+
project_id = var.project_id
37+
instance_id = stackit_edgecloud_instance.this.instance_id
38+
expiration = 3600 # seconds
39+
}
40+
```
41+
42+
<!-- schema generated by tfplugindocs -->
43+
## Schema
44+
45+
### Required
46+
47+
- `project_id` (String) STACKIT project ID to which the Edge Cloud instance is associated.
48+
49+
### Optional
50+
51+
- `expiration` (Number) Expiration time of the kubeconfig, in seconds. Minimum is 600, Maximum is 15552000. Defaults to `3600`
52+
- `instance_id` (String) ID of the Edge Cloud instance.
53+
- `instance_name` (String) Name of the Edge Cloud instance.
54+
- `recreate_before` (Number) Number of seconds before expiration to trigger recreation of the kubeconfig at.
55+
- `region` (String) The resource region. If not defined, the provider region is used.
56+
57+
### Read-Only
58+
59+
- `creation_time` (String) Date-time when the kubeconfig was created
60+
- `expires_at` (String) Timestamp when the kubeconfig expires
61+
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_name` or `instance_id`,`kubeconfig_id`".
62+
- `kubeconfig` (String, Sensitive) Raw kubeconfig.
63+
- `kubeconfig_id` (String) Internally generated UUID to identify a kubeconfig resource in Terraform, since the Edge Cloud API doesn't return a kubeconfig identifier

docs/resources/edgecloud_token.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_edgecloud_token Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Edge Cloud is in private Beta and not generally available.
7+
You can contact support if you are interested in trying it out.
8+
~> 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.
9+
---
10+
11+
# stackit_edgecloud_token (Resource)
12+
13+
Edge Cloud is in private Beta and not generally available.
14+
You can contact support if you are interested in trying it out.
15+
16+
~> 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.
17+
18+
## Example Usage
19+
20+
```terraform
21+
# the instance resource only exists here to illustrate the usage of it's attribute
22+
resource "stackit_edgecloud_instance" "this" {
23+
project_id = local.project_id
24+
display_name = "example"
25+
plan_id = var.plan_id
26+
description = "some_description"
27+
}
28+
29+
resource "stackit_edgecloud_token" "by_name" {
30+
project_id = var.project_id
31+
instance_name = stackit_edgecloud_instance.this.display_name
32+
expiration = 3600 # seconds
33+
}
34+
35+
resource "stackit_edgecloud_token" "by_id" {
36+
project_id = var.project_id
37+
instance_id = stackit_edgecloud_instance.this.instance_id
38+
expiration = 3600 # seconds
39+
}
40+
```
41+
42+
<!-- schema generated by tfplugindocs -->
43+
## Schema
44+
45+
### Required
46+
47+
- `project_id` (String) STACKIT project ID to which the Edge Cloud instance is associated.
48+
49+
### Optional
50+
51+
- `expiration` (Number) Expiration time of the token, in seconds. Minimum is 600, Maximum is 15552000. Defaults to `3600`
52+
- `instance_id` (String) ID of the Edge Cloud instance.
53+
- `instance_name` (String) Name of the Edge Cloud instance.
54+
- `recreate_before` (Number) Number of seconds before expiration to trigger recreation of the token at.
55+
- `region` (String) The resource region. If not defined, the provider region is used.
56+
57+
### Read-Only
58+
59+
- `creation_time` (String) Date-time when the token was created
60+
- `expires_at` (String) Timestamp when the token expires
61+
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_name` or `instance_id`,`token_id`".
62+
- `token` (String, Sensitive) Raw token.
63+
- `token_id` (String) Internally generated UUID to identify a token resource in Terraform, since the Edge Cloud API doesnt return a token identifier
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# returns all Edge Cloud instances created in the given project which are inside the provider default_region
3+
data "stackit_edgecloud_instances" "plan_id" {
4+
project_id = var.project_id
5+
}
6+
7+
# returns all Edge Cloud instances created in the given project in the given region
8+
data "stackit_edgecloud_instances" "plan_id" {
9+
project_id = var.project_id
10+
region = var.region
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "stackit_edgecloud_plans" "this" {
2+
project_id = var.project_id
3+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
locals {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
display_name = "edge"
4+
plan_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5+
description = "cats live on the edge"
6+
region = "eu01"
7+
}
8+
9+
resource "stackit_edgecloud_instance" "this" {
10+
project_id = local.project_id
11+
display_name = local.display_name
12+
plan_id = local.plan_id
13+
description = local.description
14+
}
15+
16+
# Only use the import statement, if you want to import an existing Edge Cloud instance resource
17+
import {
18+
to = stackit_edgecloud_instance.this
19+
id = "${local.project_id},${local.region},INSTANCE_ID"
20+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# the instance resource only exists here to illustrate the usage of it's attribute
2+
resource "stackit_edgecloud_instance" "this" {
3+
project_id = local.project_id
4+
display_name = "example"
5+
plan_id = var.plan_id
6+
description = "some_description"
7+
}
8+
9+
resource "stackit_edgecloud_kubeconfig" "by_name" {
10+
project_id = var.project_id
11+
instance_name = stackit_edgecloud_instance.this.display_name
12+
expiration = 3600 # seconds
13+
}
14+
15+
resource "stackit_edgecloud_kubeconfig" "by_id" {
16+
project_id = var.project_id
17+
instance_id = stackit_edgecloud_instance.this.instance_id
18+
expiration = 3600 # seconds
19+
}

0 commit comments

Comments
 (0)