1. Registry
  2. Packages
  3. Pulumi Cloud (Pulumi Service provider)
  4. API Docs
  5. buildStackMatchRule
Viewing docs for Pulumi Cloud v1.5.0
published on Monday, Oct 19, 2026 by Pulumi
pulumiservice logo pulumiservice logo
Viewing docs for Pulumi Cloud v1.5.0
published on Monday, Oct 19, 2026 by Pulumi

    Builds a policy group’s stack match rule from tag rules, without writing Pulumi Cloud’s expression format by hand. Use the result as a policy group’s stackMatchRule. Pulumi Cloud adds the stacks the rule matches to the group, alongside the stacks added individually, and keeps membership up to date as stack tags change. Match rules are a preview feature of Pulumi Cloud.

    Using buildStackMatchRule

    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 buildStackMatchRule(args: BuildStackMatchRuleArgs, opts?: InvokeOptions): Promise<BuildStackMatchRuleResult>
    function buildStackMatchRuleOutput(args: BuildStackMatchRuleOutputArgs, opts?: InvokeOutputOptions): Output<BuildStackMatchRuleResult>
    def build_stack_match_rule(rules: Optional[Sequence[PolicyGroupMatchRule]] = None,
                               opts: Optional[InvokeOptions] = None) -> BuildStackMatchRuleResult
    def build_stack_match_rule_output(rules: pulumi.Input[Optional[Sequence[pulumi.Input[PolicyGroupMatchRuleArgs]]]] = None,
                               opts: Optional[InvokeOutputOptions] = None) -> Output[BuildStackMatchRuleResult]
    func BuildStackMatchRule(ctx *Context, args *BuildStackMatchRuleArgs, opts ...InvokeOption) (*BuildStackMatchRuleResult, error)
    func BuildStackMatchRuleOutput(ctx *Context, args *BuildStackMatchRuleOutputArgs, opts ...InvokeOption) BuildStackMatchRuleResultOutput

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

    public static class BuildStackMatchRule 
    {
        public static Task<BuildStackMatchRuleResult> InvokeAsync(BuildStackMatchRuleArgs args, InvokeOptions? opts = null)
        public static Output<BuildStackMatchRuleResult> Invoke(BuildStackMatchRuleInvokeArgs args, InvokeOptions? opts = null)
        public static Output<BuildStackMatchRuleResult> Invoke(BuildStackMatchRuleInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<BuildStackMatchRuleResult> buildStackMatchRule(BuildStackMatchRuleArgs args, InvokeOptions options)
    public static Output<BuildStackMatchRuleResult> buildStackMatchRule(BuildStackMatchRuleArgs args, InvokeOptions options)
    public static Output<BuildStackMatchRuleResult> buildStackMatchRule(BuildStackMatchRuleArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: pulumiservice:buildStackMatchRule
      arguments:
        # arguments dictionary
    data "pulumiservice_build_stack_match_rule" "name" {
        # arguments
    }

    The following arguments are supported:

    Rules List<Pulumi.PulumiService.Inputs.PolicyGroupMatchRule>
    The rules. An entity matches if it matches any rule.
    Rules []PolicyGroupMatchRule
    The rules. An entity matches if it matches any rule.
    rules list(object)
    The rules. An entity matches if it matches any rule.
    rules List<PolicyGroupMatchRule>
    The rules. An entity matches if it matches any rule.
    rules PolicyGroupMatchRule[]
    The rules. An entity matches if it matches any rule.
    rules Sequence[PolicyGroupMatchRule]
    The rules. An entity matches if it matches any rule.
    rules List<Property Map>
    The rules. An entity matches if it matches any rule.

    buildStackMatchRule Result

    The following output properties are available:

    MatchRule Dictionary<string, object>
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.
    MatchRule map[string]interface{}
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.
    match_rule map(any)
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.
    matchRule Map<String,Object>
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.
    matchRule {[key: string]: any}
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.
    match_rule Mapping[str, Any]
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.
    matchRule Map<Any>
    The match rule, as the Pulumi Cloud expression a policy group's match rule field takes.

    Supporting Types

    PolicyGroupMatchRule

    Conditions List<Pulumi.PulumiService.Inputs.PolicyGroupTagCondition>
    Tag conditions that must all hold for the rule to match. At least one is required.
    Conditions []PolicyGroupTagCondition
    Tag conditions that must all hold for the rule to match. At least one is required.
    conditions list(object)
    Tag conditions that must all hold for the rule to match. At least one is required.
    conditions List<PolicyGroupTagCondition>
    Tag conditions that must all hold for the rule to match. At least one is required.
    conditions PolicyGroupTagCondition[]
    Tag conditions that must all hold for the rule to match. At least one is required.
    conditions Sequence[PolicyGroupTagCondition]
    Tag conditions that must all hold for the rule to match. At least one is required.
    conditions List<Property Map>
    Tag conditions that must all hold for the rule to match. At least one is required.

    PolicyGroupTagCondition

    Key string
    The tag key.
    Operator Pulumi.PulumiService.PolicyGroupTagOperator
    How the tag is compared. Defaults to equals.
    Value string
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.
    Key string
    The tag key.
    Operator PolicyGroupTagOperator
    How the tag is compared. Defaults to equals.
    Value string
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.
    key string
    The tag key.
    operator "equals" | "notEquals" | "exists" | "notExists"
    How the tag is compared. Defaults to equals.
    value string
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.
    key String
    The tag key.
    operator PolicyGroupTagOperator
    How the tag is compared. Defaults to equals.
    value String
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.
    key string
    The tag key.
    operator PolicyGroupTagOperator
    How the tag is compared. Defaults to equals.
    value string
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.
    key str
    The tag key.
    operator PolicyGroupTagOperator
    How the tag is compared. Defaults to equals.
    value str
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.
    key String
    The tag key.
    operator "equals" | "notEquals" | "exists" | "notExists"
    How the tag is compared. Defaults to equals.
    value String
    The tag value. Required with equals and notEquals, and not allowed with exists and notExists.

    PolicyGroupTagOperator

    Package Details

    Repository
    pulumiservice pulumi/pulumi-pulumiservice
    License
    Apache-2.0
    pulumiservice logo pulumiservice logo
    Viewing docs for Pulumi Cloud v1.5.0
    published on Monday, Oct 19, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial