Skip to content

Commit b4d0bbb

Browse files
authored
Merge pull request #78 from umich-vci/fix_import
Fix import
2 parents 3cab1ba + 2bd718c commit b4d0bbb

17 files changed

+120
-58
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.4.3 (March 26, 2024)
2+
3+
BREAKING CHANGES:
4+
* IDs must be treated as a string so that import works correctly.
5+
16
## 0.4.2 (March 25, 2024)
27

38
BUG FIXES:

docs/data-sources/entity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ output "bluecat_config_id" {
3434

3535
### Read-Only
3636

37-
- `id` (Number) Entity identifier
37+
- `id` (String) Entity identifier
3838
- `properties` (String) The properties of the entity as returned by the API (pipe delimited).

docs/data-sources/host_record.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ output "bluecat_host_addresses" {
3333

3434
- `address_ids` (Set of Number) A set of all address ids associated with the host record.
3535
- `addresses` (Set of String) A set of all addresses associated with the host record.
36-
- `id` (Number) Entity identifier
36+
- `id` (String) Entity identifier
3737
- `name` (String) The short name of the host record.
3838
- `parent_id` (Number) The ID of the parent of the host record.
3939
- `parent_type` (String) The type of the parent of the host record.

docs/data-sources/ip4_address.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ output "bluecat_address_mac" {
3434
### Read-Only
3535

3636
- `custom_properties` (Map of String) A map of all custom properties associated with the IPv4 address.
37-
- `id` (Number) IP4 Address identifier
37+
- `id` (String) IP4 Address identifier
3838
- `mac_address` (String) The MAC address associated with the IPv4 address.
3939
- `name` (String) The name assigned to the IPv4 address. This is not related to DNS.
4040
- `properties` (String) The properties of the IPv4 address as returned by the API (pipe delimited).

docs/data-sources/ip4_nbr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ output "bluecat_network_name" {
4444
- `default_view` (Number) The object id of the default DNS View for the network.
4545
- `dns_restrictions` (Set of Number) TODO
4646
- `gateway` (String) The gateway of the IPv4 network.
47-
- `id` (Number) Example identifier
47+
- `id` (String) Example identifier
4848
- `inherit_allow_duplicate_host` (Boolean) Duplicate host names check is inherited.
4949
- `inherit_default_domains` (Boolean) Default domains are inherited.
5050
- `inherit_default_view` (Boolean) The default DNS View is inherited.

docs/data-sources/ip4_network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Data source to access the attributes of an IPv4 network from a hint based search
2828
- `default_view` (Number) The object id of the default DNS View for the network.
2929
- `dns_restrictions` (Set of Number) The object ids of the DNS restrictions for the network.
3030
- `gateway` (String) The gateway of the IP4Network.
31-
- `id` (Number) The ID assigned to the IP4Network.
31+
- `id` (String) The ID assigned to the IP4Network.
3232
- `inherit_allow_duplicate_host` (Boolean) Duplicate host names check is inherited.
3333
- `inherit_default_domains` (Boolean) Default domains are inherited.
3434
- `inherit_default_view` (Boolean) The default DNS View is inherited.

docs/resources/host_record.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ output "bluecat_hostname_fqdn" {
4545

4646
- `absolute_name` (String) The absolute name (fqdn) of the host record.
4747
- `address_ids` (Set of Number) A set of all address ids associated with the host record.
48-
- `id` (Number) Host Record identifier
48+
- `id` (String) Host Record identifier
4949
- `properties` (String) The properties of the host record as returned by the API (pipe delimited).
5050
- `type` (String) The type of the resource.

docs/resources/ip4_address.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ output "allocated_address" {
4444

4545
- `address` (String) The IPv4 address that was allocated.
4646
- `expiry_time` (String) Time that IPv4 address lease expires.
47-
- `id` (Number) IPv4 Address identifier.
47+
- `id` (String) IPv4 Address identifier.
4848
- `lease_time` (String) Time that IPv4 address was leased.
4949
- `location_inherited` (Boolean) The location is inherited.
5050
- `parameter_request_list` (String) Time that IPv4 address lease expires.

docs/resources/ip4_network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ output "bluecat_ip4_network_cidr" {
5454
### Read-Only
5555

5656
- `cidr` (String) The CIDR address of the IPv4 network.
57-
- `id` (Number) IPv4 Network identifier.
57+
- `id` (String) IPv4 Network identifier.
5858
- `location_inherited` (Boolean) The location is inherited.
5959
- `properties` (String) The properties of the resource as returned by the API (pipe delimited).
6060
- `shared_network` (String) The name of the shared network tag associated with the IP4 Network.

internal/provider/data_source_entity.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package provider
33
import (
44
"context"
55
"fmt"
6+
"strconv"
67

78
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
89
"github.com/hashicorp/terraform-plugin-framework/datasource"
@@ -27,7 +28,7 @@ type entityDataSource struct {
2728

2829
// ExampleDataSourceModel describes the data source data model.
2930
type EntityDataSourceModel struct {
30-
Id types.Int64 `tfsdk:"id"`
31+
Id types.String `tfsdk:"id"`
3132
Name types.String `tfsdk:"name"`
3233
Type types.String `tfsdk:"type"`
3334
ParentID types.Int64 `tfsdk:"parent_id"`
@@ -44,7 +45,7 @@ func (d *entityDataSource) Schema(ctx context.Context, req datasource.SchemaRequ
4445
MarkdownDescription: "Data source to access the attributes of a BlueCat entity.",
4546

4647
Attributes: map[string]schema.Attribute{
47-
"id": schema.Int64Attribute{
48+
"id": schema.StringAttribute{
4849
MarkdownDescription: "Entity identifier",
4950
Computed: true,
5051
},
@@ -126,7 +127,7 @@ func (d *entityDataSource) Read(ctx context.Context, req datasource.ReadRequest,
126127
return
127128
}
128129

129-
data.Id = types.Int64Value(*entity.Id)
130+
data.Id = types.StringValue(strconv.FormatInt(*entity.Id, 10))
130131
data.Properties = types.StringValue(*entity.Properties)
131132

132133
resp.Diagnostics.Append(clientLogout(ctx, &client, mutex)...)

0 commit comments

Comments
 (0)