Skip to content

Commit

Permalink
feat: Add netbox_dcim_rack resource
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Apr 22, 2023
1 parent a0c4808 commit 5c8fe86
Show file tree
Hide file tree
Showing 6 changed files with 788 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/resources/netbox_dcim_rack/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Racks can be imported by id
terraform import netbox_dcim_rack.rack_test 1
83 changes: 83 additions & 0 deletions examples/resources/netbox_dcim_rack/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
resource "netbox_dcim_rack" "rack_test" {
name = "Test rack"
site_id = 1
height = 10
width = 10

tag {
name = "tag1"
slug = "tag1"
}

custom_field {
name = "cf_boolean"
type = "boolean"
value = "true"
}

custom_field {
name = "cf_date"
type = "date"
value = "2020-12-25"
}

custom_field {
name = "cf_text"
type = "text"
value = "some text"
}

custom_field {
name = "cf_integer"
type = "integer"
value = "10"
}

custom_field {
name = "cf_selection"
type = "select"
value = "1"
}

custom_field {
name = "cf_url"
type = "url"
value = "https://github.com"
}

custom_field {
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
Loading

0 comments on commit 5c8fe86

Please sign in to comment.