Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DNS fields inside instance object #18

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading