From a921a31e13940d43386d6fbe6b6ba42f110b9781 Mon Sep 17 00:00:00 2001 From: Theo Bob Massard Date: Wed, 19 Feb 2025 11:45:54 +0100 Subject: [PATCH] fix(user-data): allow cloud-init configuration Signed-off-by: Theo Bob Massard --- README.md | 1 + main.tf | 2 +- variables.tf | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ee16b6..4f6c54f 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ module "my_instance" { | [security_group_id](#input_security_group_id) | ID of the security group the server is attached to. | `string` | `null` | no | | [state](#input_state) | State of the server. Default to 'started'. Possible values are: 'started', 'stopped' or 'standby'. | `string` | `"started"` | no | | [tags](#input_tags) | Tags associated with the server and dedicated ip address. | `list(string)` | `[]` | no | +| [user_data](#input_user_data) | User data associated with the server. Use the cloud-init key to use cloud-init on your instance. You can define values using: - string - UTF-8 encoded file content using file - Binary files using filebase64. | `any` | `null` | no | | [zone](#input_zone) | The zone in which the instance should be created. Ressource will be created in the zone set at the provider level if null. | `string` | `null` | no | ## Outputs diff --git a/main.tf b/main.tf index 9f24d23..cf521ef 100644 --- a/main.tf +++ b/main.tf @@ -37,7 +37,7 @@ resource "scaleway_instance_server" "this" { boot_type = var.boot_type bootscript_id = var.bootscript_id state = var.state - # user_data = var.user_data + user_data = var.user_data project_id = var.project_id zone = var.zone diff --git a/variables.tf b/variables.tf index 444b469..5e9f727 100644 --- a/variables.tf +++ b/variables.tf @@ -108,11 +108,11 @@ variable "state" { } } -# variable "user_data" { -# type = any -# description = "User data associated with the server. Use the cloud-init key to use cloud-init on your instance. You can define values using:\n- string\n- UTF-8 encoded file content using file\n- Binary files using filebase64." -# default = null -# } +variable "user_data" { + type = any + description = "User data associated with the server. Use the cloud-init key to use cloud-init on your instance. You can define values using:\n- string\n- UTF-8 encoded file content using file\n- Binary files using filebase64." + default = null +} # Location & Tenancy variable "project_id" {