Skip to content

Commit 69217df

Browse files
authored
Merge branch 'main' into feat/add-datasource-to-query-machine-types
2 parents 4440621 + 721e10a commit 69217df

128 files changed

Lines changed: 866 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ To test your changes locally, you have to compile the provider (requires Go 1.24
121121

122122
1. Go to the copied example and initialize Terraform by running `terraform init -reconfigure -upgrade`. This will throw an error ("Failed to query available provider packages") which can be ignored since we are using the local provider build.
123123
> Note: Terraform will store its resources' states locally. To allow multiple people to use the same resources, check [Setup for multi-person usage](#setup-centralized-terraform-state)
124-
1. Setup authentication by setting the env var `STACKIT_SERVICE_ACCOUNT_TOKEN` as a valid token (see [Authentication](#authentication) for more details on how to autenticate).
124+
1. Setup authentication (see [Authentication](#authentication) for more details on how to authenticate).
125125
1. Run `terraform plan` or `terraform apply` commands.
126126
1. To debug the terraform provider, execute the following steps:
127127
* install the compiled terraform provider to binary path defined in the .terraformrc file

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Check one of the examples in the [examples](examples/) folder.
3737
To authenticate, you will need a [service account](https://docs.stackit.cloud/stackit/en/service-accounts-134415819.html). Create it in the [STACKIT Portal](https://portal.stackit.cloud/) and assign the necessary permissions to it, e.g. `project.owner`. There are multiple ways to authenticate:
3838

3939
- Key flow (recommended)
40-
- Token flow
40+
- Token flow (is scheduled for deprecation and will be removed on December 17, 2025.)
4141

4242
When setting up authentication, the provider will always try to use the key flow first and search for credentials in several locations, following a specific order:
4343

@@ -112,6 +112,8 @@ To configure the key flow, follow this steps:
112112
113113
### Token flow
114114

115+
> Is scheduled for deprecation and will be removed on December 17, 2025.
116+
115117
Using this flow is less secure since the token is long-lived. You can provide the token in several ways:
116118

117119
1. Setting the field `service_account_token` in the provider

docs/guides/import_resources.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
page_title: "How to import an existing resources"
3+
---
4+
# How to import an existing resources?
5+
6+
## 1. **Create a terraform config file and add an import block for your resource**
7+
8+
In order to import an existing resources in terraform you need to add an import block for the corresponding resource in a terraform config file.
9+
There is an example for every resource under the [examples](../../examples/) folder.
10+
11+
E.g. the import statement for a `stackit_volume` looks like the following:
12+
13+
```terraform
14+
import {
15+
to = stackit_volume.import-example
16+
id = "${var.project_id},${var.volume_id}"
17+
}
18+
```
19+
20+
## 2. **Generate the destination resource automatically**
21+
22+
Run `terraform plan -generate-config-out=generated.tf` to let terraform generate the configuration for you.
23+
In this step the `stackit_volume.import-example` resource is generated and filled with informations of your existing resource.
24+
25+
## 3. **Finish the import**
26+
27+
Run `terraform apply` to add your resource to the terraform state.

docs/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ provider "stackit" {
1111
1212
# Authentication
1313
14-
# Token flow
14+
# Token flow (scheduled for deprecation and will be removed on December 17, 2025)
1515
provider "stackit" {
1616
default_region = "eu01"
1717
service_account_token = var.service_account_token
@@ -37,7 +37,7 @@ provider "stackit" {
3737
To authenticate, you will need a [service account](https://docs.stackit.cloud/stackit/en/service-accounts-134415819.html). Create it in the [STACKIT Portal](https://portal.stackit.cloud/) and assign it the necessary permissions, e.g. `project.owner`. There are multiple ways to authenticate:
3838

3939
- Key flow (recommended)
40-
- Token flow
40+
- Token flow (is scheduled for deprecation and will be removed on December 17, 2025)
4141

4242
When setting up authentication, the provider will always try to use the key flow first and search for credentials in several locations, following a specific order:
4343

@@ -112,6 +112,8 @@ To configure the key flow, follow this steps:
112112

113113
### Token flow
114114

115+
> Is scheduled for deprecation and will be removed on December 17, 2025.
116+
115117
Using this flow is less secure since the token is long-lived. You can provide the token in several ways:
116118

117119
1. Setting the field `service_account_token` in the provider
@@ -182,7 +184,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
182184
- `service_account_email` (String, Deprecated) Service account email. It can also be set using the environment variable STACKIT_SERVICE_ACCOUNT_EMAIL. It is required if you want to use the resource manager project resource.
183185
- `service_account_key` (String) Service account key used for authentication. If set, the key flow will be used to authenticate all operations.
184186
- `service_account_key_path` (String) Path for the service account key used for authentication. If set, the key flow will be used to authenticate all operations.
185-
- `service_account_token` (String) Token used for authentication. If set, the token flow will be used to authenticate all operations.
187+
- `service_account_token` (String, Deprecated) Token used for authentication. If set, the token flow will be used to authenticate all operations.
186188
- `service_enablement_custom_endpoint` (String) Custom endpoint for the Service Enablement API
187189
- `ske_custom_endpoint` (String) Custom endpoint for the Kubernetes Engine (SKE) service
188190
- `sqlserverflex_custom_endpoint` (String) Custom endpoint for the SQL Server Flex service

docs/resources/affinity_group.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ resource "stackit_affinity_group" "example" {
8787
name = "example-affinity-group-name"
8888
policy = "hard-anti-affinity"
8989
}
90+
91+
# Only use the import statement, if you want to import an existing affinity group
92+
import {
93+
to = stackit_affinity_group.import-example
94+
id = "${var.project_id},${var.affinity_group_id}"
95+
}
9096
```
9197

9298
<!-- schema generated by tfplugindocs -->

docs/resources/authorization_organization_role_assignment.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ resource "stackit_authorization_organization_role_assignment" "example" {
2121
role = "owner"
2222
subject = "john.doe@stackit.cloud"
2323
}
24+
25+
# Only use the import statement, if you want to import an existing organization role assignment
26+
import {
27+
to = stackit_authorization_organization_role_assignment.import-example
28+
id = "${var.organization_id},${var.org_role_assignment_role},${var.org_role_assignment_subject}"
29+
}
2430
```
2531

2632
<!-- schema generated by tfplugindocs -->

docs/resources/authorization_project_role_assignment.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ resource "stackit_authorization_project_role_assignment" "example" {
2121
role = "owner"
2222
subject = "john.doe@stackit.cloud"
2323
}
24+
25+
# Only use the import statement, if you want to import an existing project role assignment
26+
import {
27+
to = stackit_authorization_project_role_assignment.import-example
28+
id = "${var.project_id},${var.project_role_assignment_role},${var.project_role_assignment_subject}"
29+
}
2430
```
2531

2632
<!-- schema generated by tfplugindocs -->

docs/resources/cdn_custom_domain.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ resource "stackit_cdn_custom_domain" "example" {
2121
distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2222
name = "https://xxx.xxx"
2323
}
24+
25+
# Only use the import statement, if you want to import an existing cdn custom domain
26+
import {
27+
to = stackit_cdn_custom_domain.import-example
28+
id = "${var.project_id},${var.distribution_id},${var.custom_domain_name}"
29+
}
2430
```
2531

2632
<!-- schema generated by tfplugindocs -->

docs/resources/cdn_distribution.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "stackit_cdn_distribution" "example_distribution" {
2121
config = {
2222
backend = {
2323
type = "http"
24-
origin_url = "mybackend.onstackit.cloud"
24+
origin_url = "https://mybackend.onstackit.cloud"
2525
}
2626
regions = ["EU", "US", "ASIA", "AF", "SA"]
2727
blocked_countries = ["DE", "AT", "CH"]
@@ -31,6 +31,12 @@ resource "stackit_cdn_distribution" "example_distribution" {
3131
}
3232
}
3333
}
34+
35+
# Only use the import statement, if you want to import an existing cdn distribution
36+
import {
37+
to = stackit_cdn_distribution.import-example
38+
id = "${var.project_id},${var.distribution_id}"
39+
}
3440
```
3541

3642
<!-- schema generated by tfplugindocs -->

docs/resources/dns_record_set.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ resource "stackit_dns_record_set" "example" {
2121
comment = "Example comment"
2222
records = ["1.2.3.4"]
2323
}
24+
25+
# Only use the import statement, if you want to import an existing dns record set
26+
import {
27+
to = stackit_dns_record_set.import-example
28+
id = "${var.project_id},${var.zone_id},${var.record_set_id}"
29+
}
2430
```
2531

2632
<!-- schema generated by tfplugindocs -->

0 commit comments

Comments
 (0)