Skip to content

Commit

Permalink
Merge pull request #154 from maveonair/cluster-group-resource
Browse files Browse the repository at this point in the history
Cluster group resource
  • Loading branch information
stgraber authored Nov 4, 2024
2 parents 42f3892 + b72b2be commit 31109ef
Show file tree
Hide file tree
Showing 7 changed files with 783 additions and 6 deletions.
62 changes: 62 additions & 0 deletions docs/resources/cluster_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# incus_cluster_group

Manages an Incus cluster group.

## Example Usage

```hcl
resource "incus_cluster_group" "amd64" {
name = "amd64"
description = "x86-64 nodes"
}
```

## Argument Reference

* `name` - **Required** - Name of the cluster group.

* `config` - *Optional* - Map of key/value pairs of
[cluster group config settings](https://linuxcontainers.org/incus/docs/main/howto/cluster_groups/#configuration-options).

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

## Attribute Reference

No attributes are exported.

## Importing

Cluster groups can be imported with the following command:

```shell
terraform import incus_cluster_group.my_group [<remote>:]<name>
```

## Importing

Import ID syntax: `[<remote>:]<name>`

* `<remote>` - *Optional* - Remote name.
* `<name>` - **Required** - Cluster group name.

### Import example

Example using terraform import command:

```shell
terraform import incus_cluster_group.my_group my_group
```

Example using the import block (only available in Terraform v1.5.0 and later):

```hcl
resource "incus_cluster_group" "my_group" {
name = "my_group"
}
import {
to = incus_cluster_group.my_group
id = "my_group"
}
```
68 changes: 68 additions & 0 deletions docs/resources/cluster_group_assignment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# incus_cluster_group_assignment

Manages an Incus cluster group assignment.

## Example Usage

```hcl
resource "incus_cluster_group" "amd64" {
name = "amd64"
description = "x86-64 nodes"
}
resource "incus_cluster_group_assignment" "node_11" {
cluster_group = incus_cluster_group.amd64.name
member = "node_1"
}
```

## Argument Reference

* `cluster_group` - **Required** - Name of the cluster group.

* `member` - **Required** - Name of the cluster group member.

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

## Attribute Reference

No attributes are exported.

## Importing

Cluster groups can be imported with the following command:

```shell
terraform import incus_cluster_group_assignment.member [<remote>:]/<cluster_group>/<member>
```

## Importing

Import ID syntax: `[<remote>:]/<cluster_group>/<member>`

* `<remote>` - *Optional* - Remote name.
* `<cluster_group>` - **Required** - Cluster group name.
* `<member>` - **Required** - Cluster group member name.

### Import example

Example using terraform import command:

```shell
terraform import incus_cluster_group_assignment.node_1 /my-cluster/node-1
```

Example using the import block (only available in Terraform v1.5.0 and later):

```hcl
resource "incus_cluster_group_assignment" "node_1" {
cluster_group = "my-cluster"
member = "node-1"
}
import {
to = incus_cluster_group.mygroup
id = "/my-cluster/node-1"
}
```
Loading

0 comments on commit 31109ef

Please sign in to comment.