Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 58 additions & 0 deletions docs/resources/image_share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_image_share Resource - stackit"
subcategory: ""
description: |-
Image Share resource schema. Manages the sharing settings of a STACKIT Image.
---

# stackit_image_share (Resource)

Image Share resource schema. Manages the sharing settings of a STACKIT Image.

## Example Usage

```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
}


resource "stackit_image_share" "stackit_image_share" {
project_id = var.stackit_project_id
image_id = stackit_image.image.image_id
# either share to parent_organization or individual projects within the projects
parent_organization = true
/*projects = [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
]*/
}

import {
to = stackit_image_share.stackit_image_share
id = "${var.project_id},${var.region},${var.image_id}"
}
```

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

### Required

- `image_id` (String) The image ID to share.
- `project_id` (String) STACKIT project ID to which the image belongs.

### Optional

- `parent_organization` (Boolean) If set to true, the image is shared with all projects inside the image owners organization. Mutually exclusive with `projects`.
- `projects` (Set of String) List of project IDs to share the image with. Mutually exclusive with `parent_organization`.
- `region` (String) The resource region.

### Read-Only

- `id` (String) Terraform's internal resource ID.
24 changes: 24 additions & 0 deletions examples/resources/stackit_image_share/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
}


resource "stackit_image_share" "stackit_image_share" {
project_id = var.stackit_project_id
image_id = stackit_image.image.image_id
# either share to parent_organization or individual projects within the projects
parent_organization = true
/*projects = [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
]*/
}

import {
to = stackit_image_share.stackit_image_share
id = "${var.project_id},${var.region},${var.image_id}"
}
Loading
Loading