vra 0.13.0 published on Wednesday, May 14, 2025 by vmware
vra.getPolicyIaasResource
Explore with Pulumi AI
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:
getPolicyIaasResource Result
The following output properties are available:
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- Created
By string - The user the entity was created by.
- Criterias
List<Immutable
Dictionary<string, string>> - The policy criteria.
- Description string
- A human-friendly description for the policy instance.
- Enforcement
Type string - The type of enforcement for the policy.
- Exclude
Resource List<GetRules Policy Iaas Resource Exclude Resource Rule> - Exclude Resource Rules:
- Failure
Policy string - Failure policy to apply when the policy fails.
- Id string
- Last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Last
Updated stringBy - The user the entity was last updated by.
- Match
Conditions List<GetPolicy Iaas Resource Match Condition> - List of conditions that must be met for a request to be validated:
- Match
Expressions List<GetPolicy Iaas Resource Match Expression> - List of label selector requirements that must be met for an object to be validated:
- Match
Labels Dictionary<string, string> - Map of {key,value} pairs that must be met for an object to be validated.
- Match
Policy string - Match policy.
- Name string
- A human-friendly name used as an identifier for the policy instance.
- Org
Id string - The id of the organization this entity belongs to.
- Project
Criterias List<ImmutableDictionary<string, string>> - The project based criteria.
- Project
Id string - The id of the project this entity belongs to.
- Resource
Rules List<GetPolicy Iaas Resource Resource Rule> - Resource Rules:
- Validation
Actions List<string> - List of validation actions.
- Validations
List<Get
Policy Iaas Resource Validation> - List of CEL expressions which are used to validate admission requests:
- Search string
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- Created
By 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.
- Enforcement
Type string - The type of enforcement for the policy.
- Exclude
Resource []GetRules Policy Iaas Resource Exclude Resource Rule - Exclude Resource Rules:
- Failure
Policy string - Failure policy to apply when the policy fails.
- Id string
- Last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Last
Updated stringBy - The user the entity was last updated by.
- Match
Conditions []GetPolicy Iaas Resource Match Condition - List of conditions that must be met for a request to be validated:
- Match
Expressions []GetPolicy Iaas Resource Match Expression - List of label selector requirements that must be met for an object to be validated:
- Match
Labels map[string]string - Map of {key,value} pairs that must be met for an object to be validated.
- Match
Policy string - Match policy.
- Name string
- A human-friendly name used as an identifier for the policy instance.
- Org
Id string - The id of the organization this entity belongs to.
- Project
Criterias []map[string]string - The project based criteria.
- Project
Id string - The id of the project this entity belongs to.
- Resource
Rules []GetPolicy Iaas Resource Resource Rule - Resource Rules:
- Validation
Actions []string - List of validation actions.
- Validations
[]Get
Policy Iaas Resource Validation - List of CEL expressions which are used to validate admission requests:
- Search string
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By 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.
- enforcement
Type String - The type of enforcement for the policy.
- exclude
Resource List<GetRules Policy Iaas Resource Exclude Resource Rule> - Exclude Resource Rules:
- failure
Policy String - Failure policy to apply when the policy fails.
- id String
- last
Updated StringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated StringBy - The user the entity was last updated by.
- match
Conditions List<GetPolicy Iaas Resource Match Condition> - List of conditions that must be met for a request to be validated:
- match
Expressions List<GetPolicy Iaas Resource Match Expression> - List of label selector requirements that must be met for an object to be validated:
- match
Labels Map<String,String> - Map of {key,value} pairs that must be met for an object to be validated.
- match
Policy String - Match policy.
- name String
- A human-friendly name used as an identifier for the policy instance.
- org
Id String - The id of the organization this entity belongs to.
- project
Criterias List<Map<String,String>> - The project based criteria.
- project
Id String - The id of the project this entity belongs to.
- resource
Rules List<GetPolicy Iaas Resource Resource Rule> - Resource Rules:
- validation
Actions List<String> - List of validation actions.
- validations
List<Get
Policy Iaas Resource Validation> - List of CEL expressions which are used to validate admission requests:
- search String
- created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By 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.
- enforcement
Type string - The type of enforcement for the policy.
- exclude
Resource GetRules Policy Iaas Resource Exclude Resource Rule[] - Exclude Resource Rules:
- failure
Policy string - Failure policy to apply when the policy fails.
- id string
- last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated stringBy - The user the entity was last updated by.
- match
Conditions GetPolicy Iaas Resource Match Condition[] - List of conditions that must be met for a request to be validated:
- match
Expressions GetPolicy Iaas Resource Match Expression[] - List of label selector requirements that must be met for an object to be validated:
- match
Labels {[key: string]: string} - Map of {key,value} pairs that must be met for an object to be validated.
- match
Policy string - Match policy.
- name string
- A human-friendly name used as an identifier for the policy instance.
- org
Id string - The id of the organization this entity belongs to.
- project
Criterias {[key: string]: string}[] - The project based criteria.
- project
Id string - The id of the project this entity belongs to.
- resource
Rules GetPolicy Iaas Resource Resource Rule[] - Resource Rules:
- validation
Actions string[] - List of validation actions.
- validations
Get
Policy Iaas Resource Validation[] - 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_ Sequence[Getrules Policy Iaas Resource Exclude Resource Rule] - Exclude Resource Rules:
- failure_
policy str - Failure policy to apply when the policy fails.
- id str
- last_
updated_ strat - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last_
updated_ strby - The user the entity was last updated by.
- match_
conditions Sequence[GetPolicy Iaas Resource Match Condition] - List of conditions that must be met for a request to be validated:
- match_
expressions Sequence[GetPolicy Iaas Resource Match Expression] - 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[GetPolicy Iaas Resource Resource Rule] - Resource Rules:
- validation_
actions Sequence[str] - List of validation actions.
- validations
Sequence[Get
Policy Iaas Resource Validation] - List of CEL expressions which are used to validate admission requests:
- search str
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By 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.
- enforcement
Type String - The type of enforcement for the policy.
- exclude
Resource List<Property Map>Rules - Exclude Resource Rules:
- failure
Policy String - Failure policy to apply when the policy fails.
- id String
- last
Updated StringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated StringBy - The user the entity was last updated by.
- match
Conditions List<Property Map> - List of conditions that must be met for a request to be validated:
- match
Expressions List<Property Map> - List of label selector requirements that must be met for an object to be validated:
- match
Labels Map<String> - Map of {key,value} pairs that must be met for an object to be validated.
- match
Policy String - Match policy.
- name String
- A human-friendly name used as an identifier for the policy instance.
- org
Id String - The id of the organization this entity belongs to.
- project
Criterias List<Map<String>> - The project based criteria.
- project
Id String - The id of the project this entity belongs to.
- resource
Rules List<Property Map> - Resource Rules:
- validation
Actions 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
- Api
Groups List<string> - List of API groups the resources belong to.
- Api
Versions 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.
- Api
Groups []string - List of API groups the resources belong to.
- Api
Versions []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 List<String> - List of API groups the resources belong to.
- api
Versions 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.
- api
Groups string[] - List of API groups the resources belong to.
- api
Versions 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.
- api
Groups List<String> - List of API groups the resources belong to.
- api
Versions 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
GetPolicyIaasResourceResourceRule
- Api
Groups List<string> - List of API groups the resources belong to.
- Api
Versions 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.
- Api
Groups []string - List of API groups the resources belong to.
- Api
Versions []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 List<String> - List of API groups the resources belong to.
- api
Versions 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.
- api
Groups string[] - List of API groups the resources belong to.
- api
Versions 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.
- api
Groups List<String> - List of API groups the resources belong to.
- api
Versions 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.
- Message
Expression 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.
- Message
Expression 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.
- message
Expression 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.
- message
Expression 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.
- message
Expression 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.