Skip to content

Commit

Permalink
Merge pull request #18 from genesiscloud/GPS-405-add-instance-dns-name
Browse files Browse the repository at this point in the history
Add support for DNS fields inside instance object
  • Loading branch information
diogopms authored Jul 11, 2024
2 parents a874797 + 6c29a75 commit c8bb5de
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 1,014 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version
TFGEN := pulumi-tfgen-${PACK}
PROVIDER := pulumi-resource-${PACK}

VERSION := v0.0.26
VERSION := v0.0.27

TESTPARALLELISM := 4

WORKING_DIR := $(shell pwd)

.PHONY: development provider build_sdks build_nodejs build_go build_python build_dotnet cleanup
.PHONY: development provider build_sdks build_nodejs build_go build_python build_dotnet cleanup

development:: install_plugins provider lint_provider build_sdks install_sdks cleanup # Build the provider & SDKs for a development environment

Expand Down Expand Up @@ -102,4 +102,3 @@ install_sdks:: install_dotnet_sdk install_python_sdk install_nodejs_sdk

test::
cd examples && go test -v -tags=all -parallel ${TESTPARALLELISM} -timeout 2h

2 changes: 1 addition & 1 deletion genesiscloudshim/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.22.1
replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20230912190043-e6d96b3b8f7e

require (
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.7
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.8
github.com/hashicorp/terraform-plugin-framework v1.8.0
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"genesiscloud:index/instance:Instance": {
"createdAt": "created_at",
"diskSize": "disk_size",
"dnsName": "dns_name",
"floatingIpId": "floating_ip_id",
"imageId": "image_id",
"placementOption": "placement_option",
Expand Down
1,006 changes: 1 addition & 1,005 deletions provider/cmd/pulumi-resource-genesiscloud/schema.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ require (
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect
github.com/genesiscloud/genesiscloud-go v1.0.8 // indirect
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.7 // indirect
github.com/genesiscloud/genesiscloud-go v1.0.9 // indirect
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.8 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.11.0 // indirect
Expand Down Expand Up @@ -117,12 +117,12 @@ require (
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 // indirect
github.com/hashicorp/terraform-plugin-framework v1.8.0 // indirect
github.com/hashicorp/terraform-plugin-framework v1.9.0 // indirect
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 // indirect
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect
Expand Down Expand Up @@ -223,7 +223,7 @@ require (
gocloud.dev/secrets/hashivault v0.27.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.6.0 // indirect
Expand Down
10 changes: 10 additions & 0 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,12 @@ github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSG
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM=
github.com/genesiscloud/genesiscloud-go v1.0.8 h1:HiRHHaST1UOgsIAko739LPICB9SkgafalJHVu26DdKk=
github.com/genesiscloud/genesiscloud-go v1.0.8/go.mod h1:OAMjSCejQTC4BBLWXleegT/fg+X46SZ6t/vW9RPtXWg=
github.com/genesiscloud/genesiscloud-go v1.0.9 h1:IiRBbO7yRZYz9pBJbRfc3DRiai666T12k/4PvhZXOTw=
github.com/genesiscloud/genesiscloud-go v1.0.9/go.mod h1:OAMjSCejQTC4BBLWXleegT/fg+X46SZ6t/vW9RPtXWg=
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.7 h1:zVzyoOL4PlJcW7FcXbxeNbOH73OlSYt6TMKHaJz5uiA=
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.7/go.mod h1:uPhkr83UCreLAtBnh2frKeunrIFlDNpyY3JhrjI68Mk=
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.8 h1:Xf1ehFJ4Uc2we289P5X1C8f8fmphO6uTjB+AIqDwems=
github.com/genesiscloud/terraform-provider-genesiscloud v1.1.8/go.mod h1:6bLjF9epL2Jr1QECp2vA1X/wJPDKrFDLHJ0R+ZJ0iQg=
github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down Expand Up @@ -1182,6 +1186,8 @@ github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down Expand Up @@ -1211,6 +1217,8 @@ github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7
github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A=
github.com/hashicorp/terraform-plugin-framework v1.8.0 h1:P07qy8RKLcoBkCrY2RHJer5AEvJnDuXomBgou6fD8kI=
github.com/hashicorp/terraform-plugin-framework v1.8.0/go.mod h1:/CpTukO88PcL/62noU7cuyaSJ4Rsim+A/pa+3rUVufY=
github.com/hashicorp/terraform-plugin-framework v1.9.0 h1:caLcDoxiRucNi2hk8+j3kJwkKfvHznubyFsJMWfZqKU=
github.com/hashicorp/terraform-plugin-framework v1.9.0/go.mod h1:qBXLDn69kM97NNVi/MQ9qgd1uWWsVftGSnygYG1tImM=
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E=
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc=
Expand Down Expand Up @@ -2129,6 +2137,8 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
12 changes: 12 additions & 0 deletions sdk/dotnet/Genesiscloud/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public partial class Instance : global::Pulumi.CustomResource
[Output("diskSize")]
public Output<int> DiskSize { get; private set; } = null!;

/// <summary>
/// The dns name of the instance.
/// </summary>
[Output("dnsName")]
public Output<string> DnsName { get; private set; } = null!;

/// <summary>
/// The floating IP attached to the instance.
/// </summary>
Expand Down Expand Up @@ -379,6 +385,12 @@ public sealed class InstanceState : global::Pulumi.ResourceArgs
[Input("diskSize")]
public Input<int>? DiskSize { get; set; }

/// <summary>
/// The dns name of the instance.
/// </summary>
[Input("dnsName")]
public Input<string>? DnsName { get; set; }

/// <summary>
/// The floating IP attached to the instance.
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions sdk/go/genesiscloud/instance.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdk/nodejs/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export class Instance extends pulumi.CustomResource {
* The disk size of the instance in GB.
*/
public readonly diskSize!: pulumi.Output<number>;
/**
* The dns name of the instance.
*/
public /*out*/ readonly dnsName!: pulumi.Output<string>;
/**
* The floating IP attached to the instance.
*/
Expand Down Expand Up @@ -166,6 +170,7 @@ export class Instance extends pulumi.CustomResource {
const state = argsOrState as InstanceState | undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["diskSize"] = state ? state.diskSize : undefined;
resourceInputs["dnsName"] = state ? state.dnsName : undefined;
resourceInputs["floatingIpId"] = state ? state.floatingIpId : undefined;
resourceInputs["hostname"] = state ? state.hostname : undefined;
resourceInputs["image"] = state ? state.image : undefined;
Expand Down Expand Up @@ -212,6 +217,7 @@ export class Instance extends pulumi.CustomResource {
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["volumeIds"] = args ? args.volumeIds : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["dnsName"] = undefined /*out*/;
resourceInputs["imageId"] = undefined /*out*/;
resourceInputs["privateIp"] = undefined /*out*/;
resourceInputs["publicIp"] = undefined /*out*/;
Expand All @@ -237,6 +243,10 @@ export interface InstanceState {
* The disk size of the instance in GB.
*/
diskSize?: pulumi.Input<number>;
/**
* The dns name of the instance.
*/
dnsName?: pulumi.Input<string>;
/**
* The floating IP attached to the instance.
*/
Expand Down
28 changes: 28 additions & 0 deletions sdk/python/pulumi_genesiscloud/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class _InstanceState:
def __init__(__self__, *,
created_at: Optional[pulumi.Input[str]] = None,
disk_size: Optional[pulumi.Input[int]] = None,
dns_name: Optional[pulumi.Input[str]] = None,
floating_ip_id: Optional[pulumi.Input[str]] = None,
hostname: Optional[pulumi.Input[str]] = None,
image: Optional[pulumi.Input[str]] = None,
Expand All @@ -306,6 +307,7 @@ def __init__(__self__, *,
Input properties used for looking up and filtering Instance resources.
:param pulumi.Input[str] created_at: The timestamp when this image was created in RFC 3339.
:param pulumi.Input[int] disk_size: The disk size of the instance in GB.
:param pulumi.Input[str] dns_name: The dns name of the instance.
:param pulumi.Input[str] floating_ip_id: The floating IP attached to the instance.
:param pulumi.Input[str] hostname: The hostname of your instance. If not provided will be initially set to the `name` attribute. - If the value of this
attribute is configured and changes, Terraform will destroy and recreate the resource.
Expand Down Expand Up @@ -341,6 +343,8 @@ def __init__(__self__, *,
pulumi.set(__self__, "created_at", created_at)
if disk_size is not None:
pulumi.set(__self__, "disk_size", disk_size)
if dns_name is not None:
pulumi.set(__self__, "dns_name", dns_name)
if floating_ip_id is not None:
pulumi.set(__self__, "floating_ip_id", floating_ip_id)
if hostname is not None:
Expand Down Expand Up @@ -404,6 +408,18 @@ def disk_size(self) -> Optional[pulumi.Input[int]]:
def disk_size(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "disk_size", value)

@property
@pulumi.getter(name="dnsName")
def dns_name(self) -> Optional[pulumi.Input[str]]:
"""
The dns name of the instance.
"""
return pulumi.get(self, "dns_name")

@dns_name.setter
def dns_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "dns_name", value)

@property
@pulumi.getter(name="floatingIpId")
def floating_ip_id(self) -> Optional[pulumi.Input[str]]:
Expand Down Expand Up @@ -803,6 +819,7 @@ def _internal_init(__self__,
__props__.__dict__["type"] = type
__props__.__dict__["volume_ids"] = volume_ids
__props__.__dict__["created_at"] = None
__props__.__dict__["dns_name"] = None
__props__.__dict__["image_id"] = None
__props__.__dict__["private_ip"] = None
__props__.__dict__["public_ip"] = None
Expand All @@ -822,6 +839,7 @@ def get(resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
created_at: Optional[pulumi.Input[str]] = None,
disk_size: Optional[pulumi.Input[int]] = None,
dns_name: Optional[pulumi.Input[str]] = None,
floating_ip_id: Optional[pulumi.Input[str]] = None,
hostname: Optional[pulumi.Input[str]] = None,
image: Optional[pulumi.Input[str]] = None,
Expand Down Expand Up @@ -850,6 +868,7 @@ def get(resource_name: str,
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] created_at: The timestamp when this image was created in RFC 3339.
:param pulumi.Input[int] disk_size: The disk size of the instance in GB.
:param pulumi.Input[str] dns_name: The dns name of the instance.
:param pulumi.Input[str] floating_ip_id: The floating IP attached to the instance.
:param pulumi.Input[str] hostname: The hostname of your instance. If not provided will be initially set to the `name` attribute. - If the value of this
attribute is configured and changes, Terraform will destroy and recreate the resource.
Expand Down Expand Up @@ -887,6 +906,7 @@ def get(resource_name: str,

__props__.__dict__["created_at"] = created_at
__props__.__dict__["disk_size"] = disk_size
__props__.__dict__["dns_name"] = dns_name
__props__.__dict__["floating_ip_id"] = floating_ip_id
__props__.__dict__["hostname"] = hostname
__props__.__dict__["image"] = image
Expand Down Expand Up @@ -924,6 +944,14 @@ def disk_size(self) -> pulumi.Output[int]:
"""
return pulumi.get(self, "disk_size")

@property
@pulumi.getter(name="dnsName")
def dns_name(self) -> pulumi.Output[str]:
"""
The dns name of the instance.
"""
return pulumi.get(self, "dns_name")

@property
@pulumi.getter(name="floatingIpId")
def floating_ip_id(self) -> pulumi.Output[Optional[str]]:
Expand Down

0 comments on commit c8bb5de

Please sign in to comment.