chore(examples): Add import examples for all resources (#939)
* chore(examples): Add import examples for all resources Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> * Add guide: How to import resources Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
This commit is contained in:
parent
e62729679e
commit
721e10a02f
118 changed files with 837 additions and 5 deletions
27
examples/resources/stackit_server/resource.tf
Normal file
27
examples/resources/stackit_server/resource.tf
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
resource "stackit_server" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-server"
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "59838a89-51b1-4892-b57f-b3caf598ee2f" // Ubuntu 24.04
|
||||
}
|
||||
availability_zone = "xxxx-x"
|
||||
machine_type = "g1.1"
|
||||
network_interfaces = [
|
||||
stackit_network_interface.example.network_interface_id
|
||||
]
|
||||
}
|
||||
|
||||
# Only use the import statement, if you want to import an existing server
|
||||
# Note: There will be a conflict which needs to be resolved manually.
|
||||
# Must set a configuration value for the boot_volume.source_type and boot_volume.source_id attribute as the provider has marked it as required.
|
||||
# Since those attributes are not fetched in general from the API call, after adding them this would replace your server resource after an terraform apply.
|
||||
# In order to prevent this you need to add:
|
||||
# lifecycle {
|
||||
# ignore_changes = [ boot_volume ]
|
||||
# }
|
||||
import {
|
||||
to = stackit_server.import-example
|
||||
id = "${var.project_id},${var.server_id}"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue