1. Packages
  2. Vra Provider
  3. API Docs
  4. getPolicyIaasResource
vra 0.13.0 published on Wednesday, May 14, 2025 by vmware

vra.getPolicyIaasResource

Explore with Pulumi AI

vra logo
vra 0.13.0 published on Wednesday, May 14, 2025 by vmware

    The following examples shows how to lookup for an IaaS resource policy:

    IaaS Resource policy data source by its id:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getPolicyIaasResource({
        id: _var.vra_iaas_resource_policy_id,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_policy_iaas_resource(id=var["vra_iaas_resource_policy_id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.LookupPolicyIaasResource(ctx, &vra.LookupPolicyIaasResourceArgs{
    			Id: pulumi.StringRef(_var.Vra_iaas_resource_policy_id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetPolicyIaasResource.Invoke(new()
        {
            Id = @var.Vra_iaas_resource_policy_id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetPolicyIaasResourceArgs;
    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 this = VraFunctions.getPolicyIaasResource(GetPolicyIaasResourceArgs.builder()
                .id(var_.vra_iaas_resource_policy_id())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getPolicyIaasResource
          arguments:
            id: ${var.vra_iaas_resource_policy_id}
    

    IaaS Resource policy data source by name search:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getPolicyIaasResource({
        search: _var.vra_iaas_resource_policy_search_name,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_policy_iaas_resource(search=var["vra_iaas_resource_policy_search_name"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.LookupPolicyIaasResource(ctx, &vra.LookupPolicyIaasResourceArgs{
    			Search: pulumi.StringRef(_var.Vra_iaas_resource_policy_search_name),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetPolicyIaasResource.Invoke(new()
        {
            Search = @var.Vra_iaas_resource_policy_search_name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetPolicyIaasResourceArgs;
    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 this = VraFunctions.getPolicyIaasResource(GetPolicyIaasResourceArgs.builder()
                .search(var_.vra_iaas_resource_policy_search_name())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getPolicyIaasResource
          arguments:
            search: ${var.vra_iaas_resource_policy_search_name}
    

    Using getPolicyIaasResource

    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 getPolicyIaasResource(args: GetPolicyIaasResourceArgs, opts?: InvokeOptions): Promise<GetPolicyIaasResourceResult>
    function getPolicyIaasResourceOutput(args: GetPolicyIaasResourceOutputArgs, opts?: InvokeOptions): Output<GetPolicyIaasResourceResult>
    def get_policy_iaas_resource(id: Optional[str] = None,
                                 search: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetPolicyIaasResourceResult
    def get_policy_iaas_resource_output(id: Optional[pulumi.Input[str]] = None,
                                 search: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetPolicyIaasResourceResult]
    func LookupPolicyIaasResource(ctx *Context, args *LookupPolicyIaasResourceArgs, opts ...InvokeOption) (*LookupPolicyIaasResourceResult, error)
    func LookupPolicyIaasResourceOutput(ctx *Context, args *LookupPolicyIaasResourceOutputArgs, opts ...InvokeOption) LookupPolicyIaasResourceResultOutput

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

    public static class GetPolicyIaasResource 
    {
        public static Task<GetPolicyIaasResourceResult> InvokeAsync(GetPolicyIaasResourceArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyIaasResourceResult> Invoke(GetPolicyIaasResourceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyIaasResourceResult> getPolicyIaasResource(GetPolicyIaasResourceArgs args, InvokeOptions options)
    public static Output<GetPolicyIaasResourceResult> getPolicyIaasResource(GetPolicyIaasResourceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vra:index/getPolicyIaasResource:getPolicyIaasResource
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The id of the policy instance.
    Search string

    Search criteria to narrow down the policy instance.

    Note: One of id or search must be specified.

    Id string
    The id of the policy instance.
    Search string

    Search criteria to narrow down the policy instance.

    Note: One of id or search must be specified.

    id String
    The id of the policy instance.
    search String

    Search criteria to narrow down the policy instance.

    Note: One of id or search must be specified.

    id string
    The id of the policy instance.
    search string

    Search criteria to narrow down the policy instance.

    Note: One of id or search must be specified.

    id str
    The id of the policy instance.
    search str

    Search criteria to narrow down the policy instance.

    Note: One of id or search must be specified.

    id String
    The id of the policy instance.
    search String

    Search criteria to narrow down the policy instance.

    Note: One of id or search must be specified.

    getPolicyIaasResource Result

    The following output properties are available:

    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Criterias List<ImmutableDictionary<string, string>>
    The policy criteria.
    Description string
    A human-friendly description for the policy instance.
    EnforcementType string
    The type of enforcement for the policy.
    ExcludeResourceRules List<GetPolicyIaasResourceExcludeResourceRule>
    Exclude Resource Rules:
    FailurePolicy string
    Failure policy to apply when the policy fails.
    Id string
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    MatchConditions List<GetPolicyIaasResourceMatchCondition>
    List of conditions that must be met for a request to be validated:
    MatchExpressions List<GetPolicyIaasResourceMatchExpression>
    List of label selector requirements that must be met for an object to be validated:
    MatchLabels Dictionary<string, string>
    Map of {key,value} pairs that must be met for an object to be validated.
    MatchPolicy string
    Match policy.
    Name string
    A human-friendly name used as an identifier for the policy instance.
    OrgId string
    The id of the organization this entity belongs to.
    ProjectCriterias List<ImmutableDictionary<string, string>>
    The project based criteria.
    ProjectId string
    The id of the project this entity belongs to.
    ResourceRules List<GetPolicyIaasResourceResourceRule>
    Resource Rules:
    ValidationActions List<string>
    List of validation actions.
    Validations List<GetPolicyIaasResourceValidation>
    List of CEL expressions which are used to validate admission requests:
    Search string
    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Criterias []map[string]string
    The policy criteria.
    Description string
    A human-friendly description for the policy instance.
    EnforcementType string
    The type of enforcement for the policy.
    ExcludeResourceRules []GetPolicyIaasResourceExcludeResourceRule
    Exclude Resource Rules:
    FailurePolicy string
    Failure policy to apply when the policy fails.
    Id string
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    MatchConditions []GetPolicyIaasResourceMatchCondition
    List of conditions that must be met for a request to be validated:
    MatchExpressions []GetPolicyIaasResourceMatchExpression
    List of label selector requirements that must be met for an object to be validated:
    MatchLabels map[string]string
    Map of {key,value} pairs that must be met for an object to be validated.
    MatchPolicy string
    Match policy.
    Name string
    A human-friendly name used as an identifier for the policy instance.
    OrgId string
    The id of the organization this entity belongs to.
    ProjectCriterias []map[string]string
    The project based criteria.
    ProjectId string
    The id of the project this entity belongs to.
    ResourceRules []GetPolicyIaasResourceResourceRule
    Resource Rules:
    ValidationActions []string
    List of validation actions.
    Validations []GetPolicyIaasResourceValidation
    List of CEL expressions which are used to validate admission requests:
    Search string
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    criterias List<Map<String,String>>
    The policy criteria.
    description String
    A human-friendly description for the policy instance.
    enforcementType String
    The type of enforcement for the policy.
    excludeResourceRules List<GetPolicyIaasResourceExcludeResourceRule>
    Exclude Resource Rules:
    failurePolicy String
    Failure policy to apply when the policy fails.
    id String
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    matchConditions List<GetPolicyIaasResourceMatchCondition>
    List of conditions that must be met for a request to be validated:
    matchExpressions List<GetPolicyIaasResourceMatchExpression>
    List of label selector requirements that must be met for an object to be validated:
    matchLabels Map<String,String>
    Map of {key,value} pairs that must be met for an object to be validated.
    matchPolicy String
    Match policy.
    name String
    A human-friendly name used as an identifier for the policy instance.
    orgId String
    The id of the organization this entity belongs to.
    projectCriterias List<Map<String,String>>
    The project based criteria.
    projectId String
    The id of the project this entity belongs to.
    resourceRules List<GetPolicyIaasResourceResourceRule>
    Resource Rules:
    validationActions List<String>
    List of validation actions.
    validations List<GetPolicyIaasResourceValidation>
    List of CEL expressions which are used to validate admission requests:
    search String
    createdAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy string
    The user the entity was created by.
    criterias {[key: string]: string}[]
    The policy criteria.
    description string
    A human-friendly description for the policy instance.
    enforcementType string
    The type of enforcement for the policy.
    excludeResourceRules GetPolicyIaasResourceExcludeResourceRule[]
    Exclude Resource Rules:
    failurePolicy string
    Failure policy to apply when the policy fails.
    id string
    lastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy string
    The user the entity was last updated by.
    matchConditions GetPolicyIaasResourceMatchCondition[]
    List of conditions that must be met for a request to be validated:
    matchExpressions GetPolicyIaasResourceMatchExpression[]
    List of label selector requirements that must be met for an object to be validated:
    matchLabels {[key: string]: string}
    Map of {key,value} pairs that must be met for an object to be validated.
    matchPolicy string
    Match policy.
    name string
    A human-friendly name used as an identifier for the policy instance.
    orgId string
    The id of the organization this entity belongs to.
    projectCriterias {[key: string]: string}[]
    The project based criteria.
    projectId string
    The id of the project this entity belongs to.
    resourceRules GetPolicyIaasResourceResourceRule[]
    Resource Rules:
    validationActions string[]
    List of validation actions.
    validations GetPolicyIaasResourceValidation[]
    List of CEL expressions which are used to validate admission requests:
    search string
    created_at str
    Date when the entity was created. The date is in ISO 8601 and UTC.
    created_by str
    The user the entity was created by.
    criterias Sequence[Mapping[str, str]]
    The policy criteria.
    description str
    A human-friendly description for the policy instance.
    enforcement_type str
    The type of enforcement for the policy.
    exclude_resource_rules Sequence[GetPolicyIaasResourceExcludeResourceRule]
    Exclude Resource Rules:
    failure_policy str
    Failure policy to apply when the policy fails.
    id str
    last_updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    last_updated_by str
    The user the entity was last updated by.
    match_conditions Sequence[GetPolicyIaasResourceMatchCondition]
    List of conditions that must be met for a request to be validated:
    match_expressions Sequence[GetPolicyIaasResourceMatchExpression]
    List of label selector requirements that must be met for an object to be validated:
    match_labels Mapping[str, str]
    Map of {key,value} pairs that must be met for an object to be validated.
    match_policy str
    Match policy.
    name str
    A human-friendly name used as an identifier for the policy instance.
    org_id str
    The id of the organization this entity belongs to.
    project_criterias Sequence[Mapping[str, str]]
    The project based criteria.
    project_id str
    The id of the project this entity belongs to.
    resource_rules Sequence[GetPolicyIaasResourceResourceRule]
    Resource Rules:
    validation_actions Sequence[str]
    List of validation actions.
    validations Sequence[GetPolicyIaasResourceValidation]
    List of CEL expressions which are used to validate admission requests:
    search str
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    criterias List<Map<String>>
    The policy criteria.
    description String
    A human-friendly description for the policy instance.
    enforcementType String
    The type of enforcement for the policy.
    excludeResourceRules List<Property Map>
    Exclude Resource Rules:
    failurePolicy String
    Failure policy to apply when the policy fails.
    id String
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    matchConditions List<Property Map>
    List of conditions that must be met for a request to be validated:
    matchExpressions List<Property Map>
    List of label selector requirements that must be met for an object to be validated:
    matchLabels Map<String>
    Map of {key,value} pairs that must be met for an object to be validated.
    matchPolicy String
    Match policy.
    name String
    A human-friendly name used as an identifier for the policy instance.
    orgId String
    The id of the organization this entity belongs to.
    projectCriterias List<Map<String>>
    The project based criteria.
    projectId String
    The id of the project this entity belongs to.
    resourceRules List<Property Map>
    Resource Rules:
    validationActions List<String>
    List of validation actions.
    validations List<Property Map>
    List of CEL expressions which are used to validate admission requests:
    search String

    Supporting Types

    GetPolicyIaasResourceExcludeResourceRule

    ApiGroups List<string>
    List of API groups the resources belong to.
    ApiVersions List<string>
    List of API Versions the resources belong to.
    Operations List<string>
    List of Operations the admission hook cares about.
    Resources List<string>
    List of Resources this rule applies to.
    ApiGroups []string
    List of API groups the resources belong to.
    ApiVersions []string
    List of API Versions the resources belong to.
    Operations []string
    List of Operations the admission hook cares about.
    Resources []string
    List of Resources this rule applies to.
    apiGroups List<String>
    List of API groups the resources belong to.
    apiVersions List<String>
    List of API Versions the resources belong to.
    operations List<String>
    List of Operations the admission hook cares about.
    resources List<String>
    List of Resources this rule applies to.
    apiGroups string[]
    List of API groups the resources belong to.
    apiVersions string[]
    List of API Versions the resources belong to.
    operations string[]
    List of Operations the admission hook cares about.
    resources string[]
    List of Resources this rule applies to.
    api_groups Sequence[str]
    List of API groups the resources belong to.
    api_versions Sequence[str]
    List of API Versions the resources belong to.
    operations Sequence[str]
    List of Operations the admission hook cares about.
    resources Sequence[str]
    List of Resources this rule applies to.
    apiGroups List<String>
    List of API groups the resources belong to.
    apiVersions List<String>
    List of API Versions the resources belong to.
    operations List<String>
    List of Operations the admission hook cares about.
    resources List<String>
    List of Resources this rule applies to.

    GetPolicyIaasResourceMatchCondition

    Expression string
    Expression which will be evaluated by CEL.
    Name string
    A human-friendly name used as an identifier for the policy instance.
    Expression string
    Expression which will be evaluated by CEL.
    Name string
    A human-friendly name used as an identifier for the policy instance.
    expression String
    Expression which will be evaluated by CEL.
    name String
    A human-friendly name used as an identifier for the policy instance.
    expression string
    Expression which will be evaluated by CEL.
    name string
    A human-friendly name used as an identifier for the policy instance.
    expression str
    Expression which will be evaluated by CEL.
    name str
    A human-friendly name used as an identifier for the policy instance.
    expression String
    Expression which will be evaluated by CEL.
    name String
    A human-friendly name used as an identifier for the policy instance.

    GetPolicyIaasResourceMatchExpression

    Key string
    The label key that the selector applies to.
    Operator string
    A key's relationship to a set of values.
    Values List<string>
    An array of string values.
    Key string
    The label key that the selector applies to.
    Operator string
    A key's relationship to a set of values.
    Values []string
    An array of string values.
    key String
    The label key that the selector applies to.
    operator String
    A key's relationship to a set of values.
    values List<String>
    An array of string values.
    key string
    The label key that the selector applies to.
    operator string
    A key's relationship to a set of values.
    values string[]
    An array of string values.
    key str
    The label key that the selector applies to.
    operator str
    A key's relationship to a set of values.
    values Sequence[str]
    An array of string values.
    key String
    The label key that the selector applies to.
    operator String
    A key's relationship to a set of values.
    values List<String>
    An array of string values.

    GetPolicyIaasResourceResourceRule

    ApiGroups List<string>
    List of API groups the resources belong to.
    ApiVersions List<string>
    List of API Versions the resources belong to.
    Operations List<string>
    List of Operations the admission hook cares about.
    Resources List<string>
    List of Resources this rule applies to.
    ApiGroups []string
    List of API groups the resources belong to.
    ApiVersions []string
    List of API Versions the resources belong to.
    Operations []string
    List of Operations the admission hook cares about.
    Resources []string
    List of Resources this rule applies to.
    apiGroups List<String>
    List of API groups the resources belong to.
    apiVersions List<String>
    List of API Versions the resources belong to.
    operations List<String>
    List of Operations the admission hook cares about.
    resources List<String>
    List of Resources this rule applies to.
    apiGroups string[]
    List of API groups the resources belong to.
    apiVersions string[]
    List of API Versions the resources belong to.
    operations string[]
    List of Operations the admission hook cares about.
    resources string[]
    List of Resources this rule applies to.
    api_groups Sequence[str]
    List of API groups the resources belong to.
    api_versions Sequence[str]
    List of API Versions the resources belong to.
    operations Sequence[str]
    List of Operations the admission hook cares about.
    resources Sequence[str]
    List of Resources this rule applies to.
    apiGroups List<String>
    List of API groups the resources belong to.
    apiVersions List<String>
    List of API Versions the resources belong to.
    operations List<String>
    List of Operations the admission hook cares about.
    resources List<String>
    List of Resources this rule applies to.

    GetPolicyIaasResourceValidation

    Expression string
    Expression which will be evaluated by CEL.
    Message string
    Message displayed when validation fails.
    MessageExpression string
    CEL expression that evaluates to the validation failure message that is returned when this rule fails.
    Reason string
    Machine-readable description of why this validation failed.
    Expression string
    Expression which will be evaluated by CEL.
    Message string
    Message displayed when validation fails.
    MessageExpression string
    CEL expression that evaluates to the validation failure message that is returned when this rule fails.
    Reason string
    Machine-readable description of why this validation failed.
    expression String
    Expression which will be evaluated by CEL.
    message String
    Message displayed when validation fails.
    messageExpression String
    CEL expression that evaluates to the validation failure message that is returned when this rule fails.
    reason String
    Machine-readable description of why this validation failed.
    expression string
    Expression which will be evaluated by CEL.
    message string
    Message displayed when validation fails.
    messageExpression string
    CEL expression that evaluates to the validation failure message that is returned when this rule fails.
    reason string
    Machine-readable description of why this validation failed.
    expression str
    Expression which will be evaluated by CEL.
    message str
    Message displayed when validation fails.
    message_expression str
    CEL expression that evaluates to the validation failure message that is returned when this rule fails.
    reason str
    Machine-readable description of why this validation failed.
    expression String
    Expression which will be evaluated by CEL.
    message String
    Message displayed when validation fails.
    messageExpression String
    CEL expression that evaluates to the validation failure message that is returned when this rule fails.
    reason String
    Machine-readable description of why this validation failed.

    Package Details

    Repository
    vra vmware/terraform-provider-vra
    License
    Notes
    This Pulumi package is based on the vra Terraform Provider.
    vra logo
    vra 0.13.0 published on Wednesday, May 14, 2025 by vmware