Viewing docs for vcd 3.14.1
published on Monday, Apr 14, 2025 by vmware
published on Monday, Apr 14, 2025 by vmware
Viewing docs for vcd 3.14.1
published on Monday, Apr 14, 2025 by vmware
published on Monday, Apr 14, 2025 by vmware
Provides a VMware Cloud Director version data source to fetch the VCD version, the maximum supported API version and perform some optional checks with version constraints.
Supported in provider v3.12+. Requires System Administrator privileges.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";
const eq1051 = vcd.getVersion({
condition: "= 10.5.1",
failIfNotMatch: true,
});
const gte1042 = vcd.getVersion({
condition: ">= 10.4.2",
failIfNotMatch: false,
});
export const isGte1042 = gte1042.then(gte1042 => gte1042.matchesCondition);
const lt1050 = vcd.getVersion({
condition: "< 10.5.0",
failIfNotMatch: true,
});
const is105 = vcd.getVersion({
condition: "~> 10.5",
failIfNotMatch: true,
});
const not1051 = vcd.getVersion({
condition: "!= 10.5.1",
failIfNotMatch: true,
});
import pulumi
import pulumi_vcd as vcd
eq1051 = vcd.get_version(condition="= 10.5.1",
fail_if_not_match=True)
gte1042 = vcd.get_version(condition=">= 10.4.2",
fail_if_not_match=False)
pulumi.export("isGte1042", gte1042.matches_condition)
lt1050 = vcd.get_version(condition="< 10.5.0",
fail_if_not_match=True)
is105 = vcd.get_version(condition="~> 10.5",
fail_if_not_match=True)
not1051 = vcd.get_version(condition="!= 10.5.1",
fail_if_not_match=True)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vcd.GetVersion(ctx, &vcd.GetVersionArgs{
Condition: pulumi.StringRef("= 10.5.1"),
FailIfNotMatch: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
gte1042, err := vcd.GetVersion(ctx, &vcd.GetVersionArgs{
Condition: pulumi.StringRef(">= 10.4.2"),
FailIfNotMatch: pulumi.BoolRef(false),
}, nil)
if err != nil {
return err
}
ctx.Export("isGte1042", gte1042.MatchesCondition)
_, err = vcd.GetVersion(ctx, &vcd.GetVersionArgs{
Condition: pulumi.StringRef("< 10.5.0"),
FailIfNotMatch: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = vcd.GetVersion(ctx, &vcd.GetVersionArgs{
Condition: pulumi.StringRef("~> 10.5"),
FailIfNotMatch: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = vcd.GetVersion(ctx, &vcd.GetVersionArgs{
Condition: pulumi.StringRef("!= 10.5.1"),
FailIfNotMatch: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;
return await Deployment.RunAsync(() =>
{
var eq1051 = Vcd.GetVersion.Invoke(new()
{
Condition = "= 10.5.1",
FailIfNotMatch = true,
});
var gte1042 = Vcd.GetVersion.Invoke(new()
{
Condition = ">= 10.4.2",
FailIfNotMatch = false,
});
var lt1050 = Vcd.GetVersion.Invoke(new()
{
Condition = "< 10.5.0",
FailIfNotMatch = true,
});
var is105 = Vcd.GetVersion.Invoke(new()
{
Condition = "~> 10.5",
FailIfNotMatch = true,
});
var not1051 = Vcd.GetVersion.Invoke(new()
{
Condition = "!= 10.5.1",
FailIfNotMatch = true,
});
return new Dictionary<string, object?>
{
["isGte1042"] = gte1042.Apply(getVersionResult => getVersionResult.MatchesCondition),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetVersionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var eq1051 = VcdFunctions.getVersion(GetVersionArgs.builder()
.condition("= 10.5.1")
.failIfNotMatch(true)
.build());
final var gte1042 = VcdFunctions.getVersion(GetVersionArgs.builder()
.condition(">= 10.4.2")
.failIfNotMatch(false)
.build());
ctx.export("isGte1042", gte1042.applyValue(getVersionResult -> getVersionResult.matchesCondition()));
final var lt1050 = VcdFunctions.getVersion(GetVersionArgs.builder()
.condition("< 10.5.0")
.failIfNotMatch(true)
.build());
final var is105 = VcdFunctions.getVersion(GetVersionArgs.builder()
.condition("~> 10.5")
.failIfNotMatch(true)
.build());
final var not1051 = VcdFunctions.getVersion(GetVersionArgs.builder()
.condition("!= 10.5.1")
.failIfNotMatch(true)
.build());
}
}
variables:
eq1051:
fn::invoke:
function: vcd:getVersion
arguments:
condition: = 10.5.1
failIfNotMatch: true
gte1042:
fn::invoke:
function: vcd:getVersion
arguments:
condition: '>= 10.4.2'
failIfNotMatch: false
lt1050:
fn::invoke:
function: vcd:getVersion
arguments:
condition: < 10.5.0
failIfNotMatch: true
is105:
fn::invoke:
function: vcd:getVersion
arguments:
condition: ~> 10.5
failIfNotMatch: true
not1051:
fn::invoke:
function: vcd:getVersion
arguments:
condition: '!= 10.5.1'
failIfNotMatch: true
outputs:
isGte1042: ${gte1042.matchesCondition}
Using getVersion
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVersion(args: GetVersionArgs, opts?: InvokeOptions): Promise<GetVersionResult>
function getVersionOutput(args: GetVersionOutputArgs, opts?: InvokeOptions): Output<GetVersionResult>def get_version(condition: Optional[str] = None,
fail_if_not_match: Optional[bool] = None,
id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVersionResult
def get_version_output(condition: Optional[pulumi.Input[str]] = None,
fail_if_not_match: Optional[pulumi.Input[bool]] = None,
id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVersionResult]func GetVersion(ctx *Context, args *GetVersionArgs, opts ...InvokeOption) (*GetVersionResult, error)
func GetVersionOutput(ctx *Context, args *GetVersionOutputArgs, opts ...InvokeOption) GetVersionResultOutput> Note: This function is named GetVersion in the Go SDK.
public static class GetVersion
{
public static Task<GetVersionResult> InvokeAsync(GetVersionArgs args, InvokeOptions? opts = null)
public static Output<GetVersionResult> Invoke(GetVersionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVersionResult> getVersion(GetVersionArgs args, InvokeOptions options)
public static Output<GetVersionResult> getVersion(GetVersionArgs args, InvokeOptions options)
fn::invoke:
function: vcd:index/getVersion:getVersion
arguments:
# arguments dictionaryThe following arguments are supported:
- Condition string
- A version constraint to check against the VCD version
- Fail
If boolNot Match - Required if
conditionis set. Throws an error if the version constraint set inconditionis not met - Id string
- Condition string
- A version constraint to check against the VCD version
- Fail
If boolNot Match - Required if
conditionis set. Throws an error if the version constraint set inconditionis not met - Id string
- condition String
- A version constraint to check against the VCD version
- fail
If BooleanNot Match - Required if
conditionis set. Throws an error if the version constraint set inconditionis not met - id String
- condition string
- A version constraint to check against the VCD version
- fail
If booleanNot Match - Required if
conditionis set. Throws an error if the version constraint set inconditionis not met - id string
- condition str
- A version constraint to check against the VCD version
- fail_
if_ boolnot_ match - Required if
conditionis set. Throws an error if the version constraint set inconditionis not met - id str
- condition String
- A version constraint to check against the VCD version
- fail
If BooleanNot Match - Required if
conditionis set. Throws an error if the version constraint set inconditionis not met - id String
getVersion Result
The following output properties are available:
- Api
Version string - The maximum supported API version
- Id string
- Matches
Condition bool - It is true if the VCD version matches the constraint set in
condition - Vcd
Version string - The VCD version
- Condition string
- Fail
If boolNot Match
- Api
Version string - The maximum supported API version
- Id string
- Matches
Condition bool - It is true if the VCD version matches the constraint set in
condition - Vcd
Version string - The VCD version
- Condition string
- Fail
If boolNot Match
- api
Version String - The maximum supported API version
- id String
- matches
Condition Boolean - It is true if the VCD version matches the constraint set in
condition - vcd
Version String - The VCD version
- condition String
- fail
If BooleanNot Match
- api
Version string - The maximum supported API version
- id string
- matches
Condition boolean - It is true if the VCD version matches the constraint set in
condition - vcd
Version string - The VCD version
- condition string
- fail
If booleanNot Match
- api_
version str - The maximum supported API version
- id str
- matches_
condition bool - It is true if the VCD version matches the constraint set in
condition - vcd_
version str - The VCD version
- condition str
- fail_
if_ boolnot_ match
- api
Version String - The maximum supported API version
- id String
- matches
Condition Boolean - It is true if the VCD version matches the constraint set in
condition - vcd
Version String - The VCD version
- condition String
- fail
If BooleanNot Match
Package Details
- Repository
- vcd vmware/terraform-provider-vcd
- License
- Notes
- This Pulumi package is based on the
vcdTerraform Provider.
Viewing docs for vcd 3.14.1
published on Monday, Apr 14, 2025 by vmware
published on Monday, Apr 14, 2025 by vmware
