Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7165dd7
feat(iaas): first version
j1n-o9r Aug 11, 2026
105d2e8
switched to types.object for complex attributes
j1n-o9r Aug 24, 2026
31026e0
switch to file pointer
j1n-o9r Aug 25, 2026
b24694f
added unit test
j1n-o9r Aug 25, 2026
f0d53c1
reverse iaas utils changes
j1n-o9r Aug 25, 2026
f8bde01
remove leftover from tests and add cleanup to caller of downloadImage
j1n-o9r Aug 25, 2026
bbc5732
cleanup - especially moving to *os.File for upload as well
j1n-o9r Aug 31, 2026
b09a455
added validator and removed unnecessary fields
j1n-o9r Aug 31, 2026
aee3642
move deprecation waring to correct spot
j1n-o9r Aug 31, 2026
3fe0b56
implement xor logic
j1n-o9r Aug 31, 2026
bdcf1e7
integrate with legacy logic
j1n-o9r Aug 31, 2026
cab1778
add question
j1n-o9r Aug 31, 2026
c483153
iaas/image: change uploadImage and downloadImage in resource to use f…
j1n-o9r Sep 14, 2026
9974f84
validate: implement Validator that can be disabled, used extra functi…
j1n-o9r Sep 15, 2026
fc54ac1
iaas/image: adapt acceptance test to use new image.image_file.local.f…
j1n-o9r Sep 21, 2026
d99b2a1
iaas/image: add tf unit tests in iaas_test.go. Test XOR Validator and…
j1n-o9r Sep 21, 2026
ab35cba
add docs
j1n-o9r Sep 21, 2026
cc743ff
cleanup
j1n-o9r Sep 29, 2026
5ed8e7f
cleanup
j1n-o9r Sep 29, 2026
a01b555
adapt examples
j1n-o9r Sep 29, 2026
28719ff
add missing brace in examples/resources/stackit_image/resource.tf
j1n-o9r Oct 6, 2026
9e787e3
switch deprecation message into attribute
j1n-o9r Oct 6, 2026
2d70f74
remove unnecessary assignment of default value
j1n-o9r Oct 6, 2026
953d52a
made iaas/image.image_file.dowload experimental
j1n-o9r Oct 7, 2026
498b7f7
add removal of tmp dir after image create
j1n-o9r Oct 7, 2026
2d97035
move codeblock in iaas/image/resource.go Create for resolving the fil…
j1n-o9r Oct 20, 2026
d75d50b
add proper error handling to iaas/image/resource_test.go
j1n-o9r Oct 20, 2026
2544bb5
refactor cleanup of temp dir on exit in iaas/image/resource.go Create…
j1n-o9r Oct 20, 2026
8318fbf
make linter happy
j1n-o9r Oct 20, 2026
107f202
add leftover from rebase
j1n-o9r Oct 20, 2026
b0f4d96
add second image resource to iaas/image acc tests
j1n-o9r Oct 20, 2026
d957d52
refactor error on not being able to close response body
j1n-o9r Oct 20, 2026
44a7bf8
refactor resolveFilePath to use ref of diags
j1n-o9r Oct 20, 2026
94d7a6d
add experimental description
j1n-o9r Oct 21, 2026
e6271e6
correct tests
j1n-o9r Oct 21, 2026
056bf2c
extented min tests like max tests
j1n-o9r Oct 21, 2026
42762af
add good case paths for file validator
j1n-o9r Oct 21, 2026
253af6f
add error handling to test
j1n-o9r Oct 21, 2026
d61654e
make descriptions more clear
j1n-o9r Oct 21, 2026
81f10d0
change term from representation to configuration
j1n-o9r Oct 21, 2026
adc3c45
cosmetics
j1n-o9r Oct 21, 2026
5055db4
improved XOR relationship
j1n-o9r Oct 21, 2026
c6c8c8a
linter
j1n-o9r Oct 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ To enable experiments set the experiments field in the provider definition:
```hcl
provider "stackit" {
default_region = "eu01"
experiments = ["iam", "routing-tables", "network", "dremio", "ske"]
experiments = ["iam", "routing-tables", "network", "dremio", "ske", "iaas"]
}
```

Expand Down Expand Up @@ -225,6 +225,10 @@ The fields of the resources are still subject to change.

Enables experimental SKE features. These features are subject to change and may be removed or redesigned in future releases.

#### iaas

Enables downloading files from a specified URL to the local machine before uploading them as an image resource. The underlying image fetching feature is experimental and subject to change.

## Acceptance Tests

> [!WARNING]
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ See this [example](https://professional-service.git.onstackit.cloud/professional
- `dremio_custom_endpoint` (String) Custom endpoint for the Dremio service
- `edgecloud_custom_endpoint` (String) Custom endpoint for the Edge Cloud service
- `enable_beta_resources` (Boolean) Enable beta resources. Default is false.
- `experiments` (List of String) Enables experiments. These are unstable features without official support. More information can be found in the README. Available Experiments: dremio, iam, network, routing-tables, vpc, ske
- `experiments` (List of String) Enables experiments. These are unstable features without official support. More information can be found in the README. Available Experiments: dremio, iam, network, routing-tables, vpc, ske, iaas
- `git_custom_endpoint` (String) Custom endpoint for the Git service
- `iaas_custom_endpoint` (String) Custom endpoint for the IaaS service
- `intake_custom_endpoint` (String) Custom endpoint for the Intake service
Expand Down
54 changes: 45 additions & 9 deletions docs/resources/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ Image resource schema. Must have a `region` specified in the provider configurat

```terraform
resource "stackit_image" "example_image" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-image"
disk_format = "qcow2"
local_file_path = "./path/to/image.qcow2"
min_disk_size = 10
min_ram = 5
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-image"
disk_format = "qcow2"
image_file = {
local = {
file_path = "./path/to/image.qcow2",
},
}
min_disk_size = 10
min_ram = 5
}
```

Expand All @@ -29,14 +33,15 @@ resource "stackit_image" "example_image" {
### Required

- `disk_format` (String) The disk format of the image.
- `local_file_path` (String) The filepath of the raw image file to be uploaded.
- `name` (String) The name of the image.
- `project_id` (String) STACKIT project ID to which the image is associated.

### Optional

- `config` (Attributes) Properties to set hardware and scheduling settings for an image. (see [below for nested schema](#nestedatt--config))
- `image_file` (Attributes) Configuration of an image file. (see [below for nested schema](#nestedatt--image_file))
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
- `local_file_path` (String, Deprecated) The filepath of the raw image file to be uploaded.
- `min_disk_size` (Number) The minimum disk size of the image in GB.
- `min_ram` (Number) The minimum RAM of the image in MB.
- `region` (String) The resource region. If not defined, the provider region is used.
Expand Down Expand Up @@ -69,6 +74,37 @@ Optional:
- `virtio_scsi` (Boolean) Enables the use of VirtIO SCSI to provide block device access. By default instances use VirtIO Block.


<a id="nestedatt--image_file"></a>
### Nested Schema for `image_file`

Optional:

- `download` (Attributes) Configuration of an image file to be downloaded.

~> This resource is part of the experimental feature iaas and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion. (see [below for nested schema](#nestedatt--image_file--download))
- `local` (Attributes) Configuration for uploading an image from a local file path. (see [below for nested schema](#nestedatt--image_file--local))

<a id="nestedatt--image_file--download"></a>
### Nested Schema for `image_file.download`

Required:

- `url` (String) URL to download the image from via HTTP(S). Updating this URL forces the image to be re-downloaded (triggers replacement).


<a id="nestedatt--image_file--local"></a>
### Nested Schema for `image_file.local`

Required:

- `file_path` (String) Path to the local image file on the machine running Terraform. Updating this path triggers a resource replacement.

Optional:

- `disable_plan_validation` (Boolean) If set to `true`, disables the plan-time check that verifies the file exists on the local filesystem (defaults to `false`). Useful when running plans in remote environments where the file isn't available yet.



<a id="nestedatt--checksum"></a>
### Nested Schema for `checksum`

Expand All @@ -85,11 +121,11 @@ In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://

```terraform
# Only use the import statement, if you want to import an existing image
# Must set a configuration value for the local_file_path attribute as the provider has marked it as required.
# Must set a configuration value for the image_file attribute as the provider has marked it as required.
# Since this attribute is not fetched in general from the API call, after adding it this would replace your image resource after an terraform apply.
# In order to prevent this you need to add:
#lifecycle {
# ignore_changes = [ local_file_path ]
# ignore_changes = [ image_file ]
# }
import {
to = stackit_image.import-example
Expand Down
4 changes: 2 additions & 2 deletions examples/resources/stackit_image/import-by-string-id.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Only use the import statement, if you want to import an existing image
# Must set a configuration value for the local_file_path attribute as the provider has marked it as required.
# Must set a configuration value for the image_file attribute as the provider has marked it as required.
# Since this attribute is not fetched in general from the API call, after adding it this would replace your image resource after an terraform apply.
# In order to prevent this you need to add:
#lifecycle {
# ignore_changes = [ local_file_path ]
# ignore_changes = [ image_file ]
# }
import {
to = stackit_image.import-example
Expand Down
18 changes: 11 additions & 7 deletions examples/resources/stackit_image/resource.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
resource "stackit_image" "example_image" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-image"
disk_format = "qcow2"
local_file_path = "./path/to/image.qcow2"
min_disk_size = 10
min_ram = 5
}
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-image"
disk_format = "qcow2"
image_file = {
local = {
file_path = "./path/to/image.qcow2",
},
}
min_disk_size = 10
min_ram = 5
}
3 changes: 2 additions & 1 deletion stackit/internal/features/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ const (
DremioExperiment = "dremio"
VpcExperiment = "vpc"
SkeExperiment = "ske"
IaasExperiment = "iaas"
)

var AvailableExperiments = []string{DremioExperiment, IamExperiment, NetworkExperiment, RoutingTablesExperiment, VpcExperiment, SkeExperiment}
var AvailableExperiments = []string{DremioExperiment, IamExperiment, NetworkExperiment, RoutingTablesExperiment, VpcExperiment, SkeExperiment, IaasExperiment}

// Check if an experiment is valid.
func ValidExperiment(experiment string, diags *diag.Diagnostics) bool {
Expand Down
Loading
Loading