1. Packages
  2. Vcd Provider
  3. API Docs
  4. getVmSizingPolicy
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getVmSizingPolicy

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a VMware Cloud Director VM sizing policy data source. This can be used to read VM sizing policy.

    Supported in provider v3.0+ and requires VCD 10.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const tf_policy_name = vcd.getVmSizingPolicy({
        name: "my-rule",
    });
    export const policyId = tf_policy_name.then(tf_policy_name => tf_policy_name.id);
    
    import pulumi
    import pulumi_vcd as vcd
    
    tf_policy_name = vcd.get_vm_sizing_policy(name="my-rule")
    pulumi.export("policyId", tf_policy_name.id)
    
    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 {
    		tf_policy_name, err := vcd.LookupVmSizingPolicy(ctx, &vcd.LookupVmSizingPolicyArgs{
    			Name: "my-rule",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("policyId", tf_policy_name.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var tf_policy_name = Vcd.GetVmSizingPolicy.Invoke(new()
        {
            Name = "my-rule",
        });
    
        return new Dictionary<string, object?>
        {
            ["policyId"] = tf_policy_name.Apply(tf_policy_name => tf_policy_name.Apply(getVmSizingPolicyResult => getVmSizingPolicyResult.Id)),
        };
    });
    
    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.GetVmSizingPolicyArgs;
    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 tf-policy-name = VcdFunctions.getVmSizingPolicy(GetVmSizingPolicyArgs.builder()
                .name("my-rule")
                .build());
    
            ctx.export("policyId", tf_policy_name.id());
        }
    }
    
    variables:
      tf-policy-name:
        fn::invoke:
          function: vcd:getVmSizingPolicy
          arguments:
            name: my-rule
    outputs:
      policyId: ${["tf-policy-name"].id}
    

    Using getVmSizingPolicy

    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 getVmSizingPolicy(args: GetVmSizingPolicyArgs, opts?: InvokeOptions): Promise<GetVmSizingPolicyResult>
    function getVmSizingPolicyOutput(args: GetVmSizingPolicyOutputArgs, opts?: InvokeOptions): Output<GetVmSizingPolicyResult>
    def get_vm_sizing_policy(id: Optional[str] = None,
                             name: Optional[str] = None,
                             org: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetVmSizingPolicyResult
    def get_vm_sizing_policy_output(id: Optional[pulumi.Input[str]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             org: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetVmSizingPolicyResult]
    func LookupVmSizingPolicy(ctx *Context, args *LookupVmSizingPolicyArgs, opts ...InvokeOption) (*LookupVmSizingPolicyResult, error)
    func LookupVmSizingPolicyOutput(ctx *Context, args *LookupVmSizingPolicyOutputArgs, opts ...InvokeOption) LookupVmSizingPolicyResultOutput

    > Note: This function is named LookupVmSizingPolicy in the Go SDK.

    public static class GetVmSizingPolicy 
    {
        public static Task<GetVmSizingPolicyResult> InvokeAsync(GetVmSizingPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetVmSizingPolicyResult> Invoke(GetVmSizingPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVmSizingPolicyResult> getVmSizingPolicy(GetVmSizingPolicyArgs args, InvokeOptions options)
    public static Output<GetVmSizingPolicyResult> getVmSizingPolicy(GetVmSizingPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getVmSizingPolicy:getVmSizingPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string

    The name VM sizing policy

    Note: Previously, it was incorrectly stated that the org argument was required. In fact, it is not, and it has been deprecated in the resource schema. To preserve compatibility until the next release, though, the parameter is still parsed, but ignored.

    All arguments defined in vcd.VmSizingPolicy are supported.

    Id string
    Org string

    Deprecated: Deprecated

    Name string

    The name VM sizing policy

    Note: Previously, it was incorrectly stated that the org argument was required. In fact, it is not, and it has been deprecated in the resource schema. To preserve compatibility until the next release, though, the parameter is still parsed, but ignored.

    All arguments defined in vcd.VmSizingPolicy are supported.

    Id string
    Org string

    Deprecated: Deprecated

    name String

    The name VM sizing policy

    Note: Previously, it was incorrectly stated that the org argument was required. In fact, it is not, and it has been deprecated in the resource schema. To preserve compatibility until the next release, though, the parameter is still parsed, but ignored.

    All arguments defined in vcd.VmSizingPolicy are supported.

    id String
    org String

    Deprecated: Deprecated

    name string

    The name VM sizing policy

    Note: Previously, it was incorrectly stated that the org argument was required. In fact, it is not, and it has been deprecated in the resource schema. To preserve compatibility until the next release, though, the parameter is still parsed, but ignored.

    All arguments defined in vcd.VmSizingPolicy are supported.

    id string
    org string

    Deprecated: Deprecated

    name str

    The name VM sizing policy

    Note: Previously, it was incorrectly stated that the org argument was required. In fact, it is not, and it has been deprecated in the resource schema. To preserve compatibility until the next release, though, the parameter is still parsed, but ignored.

    All arguments defined in vcd.VmSizingPolicy are supported.

    id str
    org str

    Deprecated: Deprecated

    name String

    The name VM sizing policy

    Note: Previously, it was incorrectly stated that the org argument was required. In fact, it is not, and it has been deprecated in the resource schema. To preserve compatibility until the next release, though, the parameter is still parsed, but ignored.

    All arguments defined in vcd.VmSizingPolicy are supported.

    id String
    org String

    Deprecated: Deprecated

    getVmSizingPolicy Result

    The following output properties are available:

    cpus List<Property Map>
    description String
    id String
    memories List<Property Map>
    name String
    org String

    Deprecated: Deprecated

    Supporting Types

    GetVmSizingPolicyCpus

    GetVmSizingPolicyMemory

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware