From 668d57cd3b1eca79f9695481c1f32b08b113fc0e Mon Sep 17 00:00:00 2001 From: kjubybot Date: Mon, 7 Feb 2022 11:50:42 +0300 Subject: [PATCH 1/2] updated docs for pfw and kvmvm --- docs/data-sources/kvmvm.md | 2 +- docs/resources/pfw.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/data-sources/kvmvm.md b/docs/data-sources/kvmvm.md index af07a8e..4cbb1d5 100644 --- a/docs/data-sources/kvmvm.md +++ b/docs/data-sources/kvmvm.md @@ -29,12 +29,12 @@ description: |- - **account_id** (Number) ID of the account this compute instance belongs to. - **account_name** (String) Name of the account this compute instance belongs to. -- **arch** (String) Hardware architecture of this compute instance. - **boot_disk_id** (Number) This compute instance boot disk ID. - **boot_disk_size** (Number) This compute instance boot disk size in GB. - **cloud_init** (String) Placeholder for cloud_init parameters. - **cpu** (Number) Number of CPUs allocated for this compute instance. - **description** (String) User-defined text description of this compute instance. +- **driver** (String) Hardware architecture of this compute instance. - **extra_disks** (Set of Number) IDs of the extra disk(s) attached to this compute. - **image_id** (Number) ID of the OS image this compute instance is based on. - **image_name** (String) Name of the OS image this compute instance is based on. diff --git a/docs/resources/pfw.md b/docs/resources/pfw.md index b12806d..c09c5c5 100644 --- a/docs/resources/pfw.md +++ b/docs/resources/pfw.md @@ -26,9 +26,21 @@ description: |- - **id** (String) The ID of this resource. - **public_port_end** (Number) End port number (inclusive) for the ranged rule. +- **timeouts** (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) ### Read-Only - **local_ip** (String) IP address of compute instance. + +### Nested Schema for `timeouts` + +Optional: + +- **create** (String) +- **default** (String) +- **delete** (String) +- **read** (String) +- **update** (String) + From 1bf17c23c8679747024deff7ad2cce6485ac4706 Mon Sep 17 00:00:00 2001 From: kjubybot Date: Mon, 7 Feb 2022 12:14:16 +0300 Subject: [PATCH 2/2] updated id computation for pfw --- decort/resource_pfw.go | 3 ++- decort/utility_pfw.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/decort/resource_pfw.go b/decort/resource_pfw.go index fce1ff5..b5c72bf 100644 --- a/decort/resource_pfw.go +++ b/decort/resource_pfw.go @@ -25,6 +25,7 @@ Visit https://github.com/rudecs/terraform-provider-decort for full source code p package decort import ( + "fmt" "net/url" "strconv" @@ -52,7 +53,7 @@ func resourcePfwCreate(d *schema.ResourceData, m interface{}) error { return err } - d.SetId(pfwId) + d.SetId(fmt.Sprintf("%d-%s", d.Get("compute_id").(int), pfwId)) pfw, err := utilityPfwCheckPresence(d, m) if err != nil { diff --git a/decort/utility_pfw.go b/decort/utility_pfw.go index 65f4e11..aef06bf 100644 --- a/decort/utility_pfw.go +++ b/decort/utility_pfw.go @@ -4,6 +4,7 @@ import ( "encoding/json" "net/url" "strconv" + "strings" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -22,7 +23,7 @@ func utilityPfwCheckPresence(d *schema.ResourceData, m interface{}) (*PfwRecord, return nil, nil } - idS := d.Id() + idS := strings.Split(d.Id(), "-")[1] id, err := strconv.Atoi(idS) if err != nil { return nil, err