Skip to content

Commit

Permalink
Merge pull request #128 from maveonair/image_source_instance
Browse files Browse the repository at this point in the history
Change image resource to have `source_image` and `source_instance`
  • Loading branch information
stgraber authored Aug 31, 2024
2 parents 9c2ea18 + 1ed3292 commit 8f92d50
Show file tree
Hide file tree
Showing 7 changed files with 624 additions and 1,001 deletions.
41 changes: 27 additions & 14 deletions docs/resources/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,53 @@ Manages a locally-stored Incus image.
## Example Usage

```hcl
resource "incus_image" "xenial" {
source_remote = "ubuntu"
source_image = "xenial/amd64"
resource "incus_image" "alpine" {
source_image = {
remote = "images"
name = "alpine/edge"
}
}
resource "incus_instance" "test1" {
name = "test1"
image = incus_image.xenial.fingerprint
image = incus_image.alpine.fingerprint
ephemeral = false
}
```

## Argument Reference

* `source_image` - **Required** - Fingerprint or alias of image to pull.
* `source_instance` - *Optional* - The source image from which the image will be created. See reference below.

* `source_remote` - **Required** - Name of the Incus remote from where image will
be pulled.

* `type` - *Optional* - Type of image to cache. Must be one of `container` or
`virtual-machine`. Defaults to `container`.
* `source_instance` - *Optional* - The source instance from which the image will be created. See reference below.

* `aliases` - *Optional* - A list of aliases to assign to the image after
pulling.

* `copy_aliases` - *Optional* - Whether to copy the aliases of the image from
the remote. Valid values are `true` and `false`. Defaults to `true`.

* `project` - *Optional* - Name of the project where the image will be stored.

* `remote` - *Optional* - The remote in which the resource will be created. If
not provided, the provider's default remote will be used.

* `architecture` - The image architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values.
The `source_image` block supports:

* `remote` - **Required** - The remote where the image will be pulled from.

* `name` - **Required** - Name of the image.

* `type` - *Optional* - Type of image to cache. Must be one of `container` or
`virtual-machine`. Defaults to `container`.

* `architecture` - *Optional* - The image architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values.

* `copy_aliases` - *Optional* - Whether to copy the aliases of the image from
the remote. Valid values are `true` and `false`. Defaults to `true`.

The `source_instance` block supports:

* `name` - **Required** - Name of the source instance.

* `snapshot`- *Optional* - Name of the snapshot of the source instance

## Attribute Reference

Expand Down
60 changes: 0 additions & 60 deletions docs/resources/image_publish.md

This file was deleted.

Loading

0 comments on commit 8f92d50

Please sign in to comment.