Skip to content

Commit

Permalink
Upgrade terraform-provider-vsphere to v2.9.2 (#591)
Browse files Browse the repository at this point in the history
This PR was generated via `$ upgrade-provider pulumi/pulumi-vsphere`.

---

- Updating Java Gen version from 0.15.0 to 0.16.1.
- Upgrading terraform-provider-vsphere from 2.9.1  to 2.9.2.
	Fixes #590
  • Loading branch information
iwahbe authored Sep 17, 2024
1 parent 125b18d commit 7156982
Show file tree
Hide file tree
Showing 13 changed files with 184 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .pulumi-java-gen.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.15.0
0.16.1
10 changes: 8 additions & 2 deletions patches/0001-fork.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ index bb6ac90e..acd55b27 100644

## Importing
diff --git a/website/docs/r/compute_cluster_vm_group.html.markdown b/website/docs/r/compute_cluster_vm_group.html.markdown
index cbf0f4da..ec12c125 100644
index a1cc7619..d0dcc7d7 100644
--- a/website/docs/r/compute_cluster_vm_group.html.markdown
+++ b/website/docs/r/compute_cluster_vm_group.html.markdown
@@ -32,13 +32,11 @@ connections.
Expand Down Expand Up @@ -1230,7 +1230,7 @@ index cbf0f4da..ec12c125 100644
virtual_machine_ids = ["${vsphere_virtual_machine.vm.*.id}"]
}
```
@@ -92,26 +90,21 @@ The following arguments are supported:
@@ -92,31 +90,26 @@ The following arguments are supported:

* `name` - (Required) The name of the VM group. This must be unique in the
cluster. Forces a new resource if changed.
Expand All @@ -1253,6 +1253,12 @@ index cbf0f4da..ec12c125 100644

-[tf-vsphere-cluster-host-group-resource]: /docs/providers/vsphere/r/compute_cluster_host_group.html
-
~> **NOTE:** To update a existing VM group, you must first import the group with `import` command in
-[Importing](#importing) section. When importing a VM group, validate that all virtual machines that
+import section. When importing a VM group, validate that all virtual machines that
need to be in the group are included in the `virtual_machine_ids`; otherwise, any virtual machines
that are not in `virtual_machine_ids` the included will be removed from the group.

## Attribute Reference

The only attribute this resource exports is the `id` of the resource, which is
Expand Down
6 changes: 3 additions & 3 deletions provider/cmd/pulumi-resource-vsphere/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3265,7 +3265,7 @@
"items": {
"type": "string"
},
"description": "The UUIDs of the virtual machines in this\ngroup.\n\n\u003e **NOTE:** The namespace for cluster names on this resource (defined by the\n`name` argument) is shared with the\n`vsphere.ComputeClusterHostGroup`\nresource. Make sure your names are unique across both resources.\n"
"description": "The UUIDs of the virtual machines in this\ngroup.\n\n\u003e **NOTE:** The namespace for cluster names on this resource (defined by the\n`name` argument) is shared with the\n`vsphere.ComputeClusterHostGroup`\nresource. Make sure your names are unique across both resources.\n\n\u003e **NOTE:** To update a existing VM group, you must first import the group with `import` command in\nimport section. When importing a VM group, validate that all virtual machines that\nneed to be in the group are included in the `virtual_machine_ids`; otherwise, any virtual machines\nthat are not in `virtual_machine_ids` the included will be removed from the group.\n"
}
},
"required": [
Expand All @@ -3288,7 +3288,7 @@
"items": {
"type": "string"
},
"description": "The UUIDs of the virtual machines in this\ngroup.\n\n\u003e **NOTE:** The namespace for cluster names on this resource (defined by the\n`name` argument) is shared with the\n`vsphere.ComputeClusterHostGroup`\nresource. Make sure your names are unique across both resources.\n"
"description": "The UUIDs of the virtual machines in this\ngroup.\n\n\u003e **NOTE:** The namespace for cluster names on this resource (defined by the\n`name` argument) is shared with the\n`vsphere.ComputeClusterHostGroup`\nresource. Make sure your names are unique across both resources.\n\n\u003e **NOTE:** To update a existing VM group, you must first import the group with `import` command in\nimport section. When importing a VM group, validate that all virtual machines that\nneed to be in the group are included in the `virtual_machine_ids`; otherwise, any virtual machines\nthat are not in `virtual_machine_ids` the included will be removed from the group.\n"
}
},
"requiredInputs": [
Expand All @@ -3312,7 +3312,7 @@
"items": {
"type": "string"
},
"description": "The UUIDs of the virtual machines in this\ngroup.\n\n\u003e **NOTE:** The namespace for cluster names on this resource (defined by the\n`name` argument) is shared with the\n`vsphere.ComputeClusterHostGroup`\nresource. Make sure your names are unique across both resources.\n"
"description": "The UUIDs of the virtual machines in this\ngroup.\n\n\u003e **NOTE:** The namespace for cluster names on this resource (defined by the\n`name` argument) is shared with the\n`vsphere.ComputeClusterHostGroup`\nresource. Make sure your names are unique across both resources.\n\n\u003e **NOTE:** To update a existing VM group, you must first import the group with `import` command in\nimport section. When importing a VM group, validate that all virtual machines that\nneed to be in the group are included in the `virtual_machine_ids`; otherwise, any virtual machines\nthat are not in `virtual_machine_ids` the included will be removed from the group.\n"
}
},
"type": "object"
Expand Down
114 changes: 15 additions & 99 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package vsphere

import (
"fmt"
"path/filepath"
"path"

_ "embed" // Allow embedding state

"github.com/hashicorp/terraform-provider-vsphere/vsphere"

"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
tfbridgetokens "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
tks "github.com/pulumi/pulumi/sdk/v3/go/common/tokens"

"github.com/pulumi/pulumi-vsphere/provider/v4/pkg/version"
)
Expand All @@ -24,14 +24,10 @@ const (
//go:embed cmd/pulumi-resource-vsphere/bridge-metadata.json
var metadata []byte

func vsphereDataSource(mod string, res string) tokens.ModuleMember {
func vsphereDataSource(mod string, res string) tks.ModuleMember {
return tfbridge.MakeDataSource(vspherePkg, mod, res)
}

func vsphereResource(mod string, res string) tokens.Type {
return tfbridge.MakeResource(vspherePkg, mod, res)
}

func Provider() tfbridge.ProviderInfo {
p := shimv2.NewProvider(vsphere.Provider())
prov := tfbridge.ProviderInfo{
Expand Down Expand Up @@ -88,82 +84,8 @@ func Provider() tfbridge.ProviderInfo {
},
},
},
Resources: map[string]*tfbridge.ResourceInfo{
"vsphere_compute_cluster": {Tok: vsphereResource(vsphereMod, "ComputeCluster")},
"vsphere_compute_cluster_host_group": {Tok: vsphereResource(vsphereMod, "ComputeClusterHostGroup")},
"vsphere_compute_cluster_vm_affinity_rule": {
Tok: vsphereResource(vsphereMod, "ComputeClusterVmAffinityRule"),
},
"vsphere_compute_cluster_vm_anti_affinity_rule": {
Tok: vsphereResource(vsphereMod, "ComputeClusterVmAntiAffinityRule"),
},
"vsphere_compute_cluster_vm_dependency_rule": {
Tok: vsphereResource(vsphereMod, "ComputeClusterVmDependencyRule"),
},
"vsphere_compute_cluster_vm_group": {Tok: vsphereResource(vsphereMod, "ComputeClusterVmGroup")},
"vsphere_compute_cluster_vm_host_rule": {Tok: vsphereResource(vsphereMod, "ComputeClusterVmHostRule")},
"vsphere_content_library": {Tok: vsphereResource(vsphereMod, "ContentLibrary")},
"vsphere_content_library_item": {Tok: vsphereResource(vsphereMod, "ContentLibraryItem")},
"vsphere_custom_attribute": {Tok: vsphereResource(vsphereMod, "CustomAttribute")},
"vsphere_datacenter": {Tok: vsphereResource(vsphereMod, "Datacenter")},
"vsphere_datastore_cluster": {Tok: vsphereResource(vsphereMod, "DatastoreCluster")},
"vsphere_datastore_cluster_vm_anti_affinity_rule": {
Tok: vsphereResource(vsphereMod, "DatastoreClusterVmAntiAffinityRule"),
},
"vsphere_distributed_port_group": {Tok: vsphereResource(vsphereMod, "DistributedPortGroup")},
"vsphere_distributed_virtual_switch": {Tok: vsphereResource(vsphereMod, "DistributedVirtualSwitch")},
"vsphere_dpm_host_override": {Tok: vsphereResource(vsphereMod, "DpmHostOverride")},
"vsphere_drs_vm_override": {Tok: vsphereResource(vsphereMod, "DrsVmOverride")},
"vsphere_file": {Tok: vsphereResource(vsphereMod, "File")},
"vsphere_folder": {Tok: vsphereResource(vsphereMod, "Folder")},
"vsphere_ha_vm_override": {Tok: vsphereResource(vsphereMod, "HaVmOverride")},
"vsphere_host": {Tok: vsphereResource(vsphereMod, "Host")},
"vsphere_host_port_group": {Tok: vsphereResource(vsphereMod, "HostPortGroup")},
"vsphere_host_virtual_switch": {Tok: vsphereResource(vsphereMod, "HostVirtualSwitch")},
"vsphere_license": {Tok: vsphereResource(vsphereMod, "License")},
"vsphere_nas_datastore": {Tok: vsphereResource(vsphereMod, "NasDatastore")},
"vsphere_resource_pool": {Tok: vsphereResource(vsphereMod, "ResourcePool")},
"vsphere_storage_drs_vm_override": {Tok: vsphereResource(vsphereMod, "StorageDrsVmOverride")},
"vsphere_tag": {Tok: vsphereResource(vsphereMod, "Tag")},
"vsphere_tag_category": {Tok: vsphereResource(vsphereMod, "TagCategory")},
"vsphere_vapp_container": {Tok: vsphereResource(vsphereMod, "VappContainer")},
"vsphere_vapp_entity": {Tok: vsphereResource(vsphereMod, "VappEntity")},
"vsphere_virtual_disk": {Tok: vsphereResource(vsphereMod, "VirtualDisk")},
"vsphere_virtual_machine": {Tok: vsphereResource(vsphereMod, "VirtualMachine")},
"vsphere_virtual_machine_snapshot": {Tok: vsphereResource(vsphereMod, "VirtualMachineSnapshot")},
"vsphere_vmfs_datastore": {Tok: vsphereResource(vsphereMod, "VmfsDatastore")},
"vsphere_vnic": {Tok: vsphereResource(vsphereMod, "Vnic")},
"vsphere_vm_storage_policy": {Tok: vsphereResource(vsphereMod, "VmStoragePolicy")},
"vsphere_entity_permissions": {Tok: vsphereResource(vsphereMod, "EntityPermissions")},
"vsphere_role": {Tok: vsphereResource(vsphereMod, "Role")},
},
DataSources: map[string]*tfbridge.DataSourceInfo{
"vsphere_compute_cluster": {Tok: vsphereDataSource(vsphereMod, "getComputeCluster")},
"vsphere_content_library": {Tok: vsphereDataSource(vsphereMod, "getContentLibrary")},
"vsphere_content_library_item": {Tok: vsphereDataSource(vsphereMod, "getContentLibraryItem")},
"vsphere_custom_attribute": {Tok: vsphereDataSource(vsphereMod, "getCustomAttribute")},
"vsphere_datacenter": {Tok: vsphereDataSource(vsphereMod, "getDatacenter")},
"vsphere_datastore": {Tok: vsphereDataSource(vsphereMod, "getDatastore")},
"vsphere_datastore_cluster": {Tok: vsphereDataSource(vsphereMod, "getDatastoreCluster")},
"vsphere_distributed_virtual_switch": {Tok: vsphereDataSource(vsphereMod, "getDistributedVirtualSwitch")},
"vsphere_folder": {Tok: vsphereDataSource(vsphereMod, "getFolder")},
"vsphere_host": {Tok: vsphereDataSource(vsphereMod, "getHost")},
"vsphere_network": {Tok: vsphereDataSource(vsphereMod, "getNetwork")},
"vsphere_resource_pool": {Tok: vsphereDataSource(vsphereMod, "getResourcePool")},
"vsphere_tag": {Tok: vsphereDataSource(vsphereMod, "getTag")},
"vsphere_tag_category": {Tok: vsphereDataSource(vsphereMod, "getTagCategory")},
"vsphere_vapp_container": {Tok: vsphereDataSource(vsphereMod, "getVappContainer")},
"vsphere_virtual_machine": {Tok: vsphereDataSource(vsphereMod, "getVirtualMachine")},
"vsphere_vmfs_disks": {Tok: vsphereDataSource(vsphereMod, "getVmfsDisks")},
"vsphere_storage_policy": {Tok: vsphereDataSource(vsphereMod, "getPolicy")},
"vsphere_dynamic": {Tok: vsphereDataSource(vsphereMod, "getDynamic")},
"vsphere_host_pci_device": {Tok: vsphereDataSource(vsphereMod, "getHostPciDevice")},
"vsphere_host_thumbprint": {Tok: vsphereDataSource(vsphereMod, "getHostThumbprint")},
"vsphere_role": {Tok: vsphereDataSource(vsphereMod, "getRole")},
"vsphere_ovf_vm_template": {Tok: vsphereDataSource(vsphereMod, "getOvfVmTemplate")},
"vsphere_compute_cluster_host_group": {Tok: vsphereDataSource(vsphereMod, "getComputeClusterHostGroup")},
"vsphere_license": {Tok: vsphereDataSource(vsphereMod, "getLicense")},

"vsphere_storage_policy": {Tok: vsphereDataSource(vsphereMod, "getPolicy")},
"vsphere_datastore_stats": {Docs: &tfbridge.DocInfo{
Source: "datastore_stats.html .markdown", // Note extra space.
}},
Expand All @@ -178,24 +100,18 @@ func Provider() tfbridge.ProviderInfo {
DevDependencies: map[string]string{
"@types/node": "^10.9.2",
},
Overlay: &tfbridge.OverlayInfo{
Modules: map[string]*tfbridge.OverlayInfo{},
},
RespectSchemaVersion: true,
},
Python: (func() *tfbridge.PythonInfo {
i := &tfbridge.PythonInfo{
RespectSchemaVersion: true,
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
}
i.PyProject.Enabled = true
return i
})(),
Python: &tfbridge.PythonInfo{
RespectSchemaVersion: true,
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
PyProject: struct{ Enabled bool }{true},
},

Golang: &tfbridge.GolangInfo{
ImportBasePath: filepath.Join(
ImportBasePath: path.Join(
fmt.Sprintf("github.com/pulumi/pulumi-%[1]s/sdk/", vspherePkg),
tfbridge.GetModuleMajorVersion(version.Version),
"go",
Expand All @@ -215,8 +131,8 @@ func Provider() tfbridge.ProviderInfo {
},
}

prov.MustComputeTokens(tfbridgetokens.SingleModule("vsphere_", vsphereMod,
tfbridgetokens.MakeStandard(vspherePkg)))
prov.MustComputeTokens(tokens.SingleModule("vsphere_", vsphereMod,
tokens.MakeStandard(vspherePkg)))
prov.SetAutonaming(255, "-")
prov.MustApplyAutoAliases()

Expand Down
15 changes: 15 additions & 0 deletions sdk/dotnet/ComputeClusterVmGroup.cs

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

Loading

0 comments on commit 7156982

Please sign in to comment.