Skip to content

Commit 3dbd032

Browse files
committed
Add instance dns name
1 parent d78ff65 commit 3dbd032

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.21
55
toolchain go1.22.1
66

77
require (
8-
github.com/genesiscloud/genesiscloud-go v1.0.8
8+
github.com/genesiscloud/genesiscloud-go v1.0.9
99
github.com/hashicorp/go-retryablehttp v0.7.7
1010
github.com/hashicorp/terraform-plugin-docs v0.19.4
1111
github.com/hashicorp/terraform-plugin-framework v1.9.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
4747
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
4848
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
4949
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
50-
github.com/genesiscloud/genesiscloud-go v1.0.8 h1:HiRHHaST1UOgsIAko739LPICB9SkgafalJHVu26DdKk=
51-
github.com/genesiscloud/genesiscloud-go v1.0.8/go.mod h1:OAMjSCejQTC4BBLWXleegT/fg+X46SZ6t/vW9RPtXWg=
50+
github.com/genesiscloud/genesiscloud-go v1.0.9 h1:IiRBbO7yRZYz9pBJbRfc3DRiai666T12k/4PvhZXOTw=
51+
github.com/genesiscloud/genesiscloud-go v1.0.9/go.mod h1:OAMjSCejQTC4BBLWXleegT/fg+X46SZ6t/vW9RPtXWg=
5252
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
5353
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
5454
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=

internal/provider/instance_resource.go

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques
6363
stringplanmodifier.UseStateForUnknown(), // immutable
6464
},
6565
}),
66+
"dns_name": resourceenhancer.Attribute(ctx, schema.StringAttribute{
67+
MarkdownDescription: "The DNS name of the instance.",
68+
Computed: true,
69+
PlanModifiers: []planmodifier.String{
70+
stringplanmodifier.UseStateForUnknown(), // immutable
71+
},
72+
}),
6673
"id": resourceenhancer.Attribute(ctx, schema.StringAttribute{
6774
MarkdownDescription: "The unique ID of the instance.",
6875
Computed: true,

internal/provider/instance_types.go

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ type InstanceResourceModel struct {
2323
// Hostname The hostname of your instance.
2424
Hostname types.String `tfsdk:"hostname"`
2525

26+
// DNS name of the instance
27+
DnsName types.String `tfsdk:"dns_name"`
28+
2629
// Id The unique ID of the instance.
2730
Id types.String `tfsdk:"id"`
2831

@@ -92,6 +95,7 @@ func (data *InstanceResourceModel) PopulateFromClientResponse(ctx context.Contex
9295
data.Id = types.StringValue(instance.Id)
9396
data.Name = types.StringValue(instance.Name)
9497
data.Hostname = types.StringValue(instance.Hostname)
98+
data.DnsName = types.StringValue(instance.DnsName)
9599
data.Type = types.StringValue(string(instance.Type))
96100
data.ImageId = types.StringValue(instance.Image.Id)
97101

0 commit comments

Comments
 (0)