diff --git a/README.md b/README.md
index e93b5de..bcd6a2c 100644
--- a/README.md
+++ b/README.md
@@ -58,9 +58,11 @@ module "my_instance" {
| [name](#input_name) | Name of the server. | `string` | `null` | no |
| [placement_group_id](#input_placement_group_id) | ID of the placement group the server is attached to. | `string` | `null` | no |
| [private_networks](#input_private_networks) | Private networks associated with the server. | `list(string)` | `[]` | no |
+| [project_id](#input_project_id) | ID of the project the namespace is associated with. Ressource will be created in the project set at the provider level if null. | `string` | `null` | no |
| [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(any)` | `[]` | 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 |
## Authors
diff --git a/main.tf b/main.tf
index f8a3cc5..a39e56e 100644
--- a/main.tf
+++ b/main.tf
@@ -5,6 +5,9 @@ moved {
resource "scaleway_instance_ip" "this" {
count = var.enable_public_ipv4 == true ? 1 : 0
+
+ project_id = var.project_id
+ zone = var.zone
}
resource "scaleway_instance_ip_reverse_dns" "this" {
@@ -12,6 +15,7 @@ resource "scaleway_instance_ip_reverse_dns" "this" {
ip_id = scaleway_instance_ip.this[count.index].id
reverse = format("%s.%s", var.name, var.dns_zone)
+ zone = var.zone
}
resource "scaleway_instance_server" "this" {
@@ -41,6 +45,9 @@ resource "scaleway_instance_server" "this" {
bootscript_id = var.bootscript_id
state = var.state
# user_data = var.user_data
+
+ project_id = var.project_id
+ zone = var.zone
}
resource "scaleway_domain_record" "ip4" {
diff --git a/variables.tf b/variables.tf
index 412ad30..a274766 100644
--- a/variables.tf
+++ b/variables.tf
@@ -67,9 +67,9 @@ variable "enable_public_ipv4" {
}
variable "private_networks" {
- type = list(string)
+ type = list(string)
description = "Private networks associated with the server."
- default = []
+ default = []
}
# Start settings
@@ -106,3 +106,16 @@ variable "state" {
# 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" {
+ description = "ID of the project the namespace is associated with. Ressource will be created in the project set at the provider level if null."
+ type = string
+ default = null
+}
+
+variable "zone" {
+ description = "The zone in which the instance should be created. Ressource will be created in the zone set at the provider level if null."
+ type = string
+ default = null
+}