feat: Onboard affinity groups resource and data source (#652)
* onboard affinity_groups resource and data source - add tests and descriptions - fix: server doesn't use affinity_group value for payload * Update descriptions
This commit is contained in:
parent
3642260cc4
commit
b5ce160d13
10 changed files with 846 additions and 0 deletions
41
stackit/internal/services/iaas/affinitygroup/const.go
Normal file
41
stackit/internal/services/iaas/affinitygroup/const.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package affinitygroup
|
||||
|
||||
const exampleUsageWithServer = `
|
||||
|
||||
### Usage with server` + "\n" +
|
||||
"```terraform" + `
|
||||
resource "stackit_affinity_group" "affinity-group" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-key-pair"
|
||||
policy = "soft-affinity"
|
||||
}
|
||||
|
||||
resource "stackit_server" "example-server" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
affinity_group = stackit_affinity_group.affinity-group.affinity_group_id
|
||||
availability_zone = "eu01-1"
|
||||
machine_type = "g1.1"
|
||||
}
|
||||
` + "\n```"
|
||||
|
||||
const policies = `
|
||||
|
||||
### Policies
|
||||
|
||||
* ` + "`hard-affinity`" + `- All servers launched in this group will be hosted on the same compute node.
|
||||
|
||||
* ` + "`hard-anti-affinity`" + `- All servers launched in this group will be
|
||||
hosted on different compute nodes.
|
||||
|
||||
* ` + "`soft-affinity`" + `- All servers launched in this group will be hosted
|
||||
on the same compute node if possible, but if not possible they still will be scheduled instead of failure.
|
||||
|
||||
* ` + "`soft-anti-affinity`" + `- All servers launched in this group will be hosted on different compute nodes if possible,
|
||||
but if not possible they still will be scheduled instead of failure.
|
||||
`
|
||||
Loading…
Add table
Add a link
Reference in a new issue