1. Packages
  2. Harness Provider
  3. API Docs
  4. governance
  5. getRule
Harness v0.7.2 published on Tuesday, Apr 15, 2025 by Pulumi

harness.governance.getRule

Explore with Pulumi AI

Harness v0.7.2 published on Tuesday, Apr 15, 2025 by Pulumi

Datasource for looking up a rule.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const example = harness.governance.getRule({
    ruleId: "rule_id",
});
Copy
import pulumi
import pulumi_harness as harness

example = harness.governance.get_rule(rule_id="rule_id")
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/governance"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := governance.LookupRule(ctx, &governance.LookupRuleArgs{
			RuleId: "rule_id",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var example = Harness.Governance.GetRule.Invoke(new()
    {
        RuleId = "rule_id",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.governance.GovernanceFunctions;
import com.pulumi.harness.governance.inputs.GetRuleArgs;
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 example = GovernanceFunctions.getRule(GetRuleArgs.builder()
            .ruleId("rule_id")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: harness:governance:getRule
      arguments:
        ruleId: rule_id
Copy

Using getRule

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 getRule(args: GetRuleArgs, opts?: InvokeOptions): Promise<GetRuleResult>
function getRuleOutput(args: GetRuleOutputArgs, opts?: InvokeOptions): Output<GetRuleResult>
Copy
def get_rule(rule_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetRuleResult
def get_rule_output(rule_id: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetRuleResult]
Copy
func LookupRule(ctx *Context, args *LookupRuleArgs, opts ...InvokeOption) (*LookupRuleResult, error)
func LookupRuleOutput(ctx *Context, args *LookupRuleOutputArgs, opts ...InvokeOption) LookupRuleResultOutput
Copy

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

public static class GetRule 
{
    public static Task<GetRuleResult> InvokeAsync(GetRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetRuleResult> Invoke(GetRuleInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRuleResult> getRule(GetRuleArgs args, InvokeOptions options)
public static Output<GetRuleResult> getRule(GetRuleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: harness:governance/getRule:getRule
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

RuleId This property is required. string
Id of rule.
RuleId This property is required. string
Id of rule.
ruleId This property is required. String
Id of rule.
ruleId This property is required. string
Id of rule.
rule_id This property is required. str
Id of rule.
ruleId This property is required. String
Id of rule.

getRule Result

The following output properties are available:

CloudProvider string
The cloud provider for the rule.
Description string
Description for rule.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Name of the rule.
RuleId string
Id of rule.
RulesYaml string
Policy YAML of the rule.
CloudProvider string
The cloud provider for the rule.
Description string
Description for rule.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Name of the rule.
RuleId string
Id of rule.
RulesYaml string
Policy YAML of the rule.
cloudProvider String
The cloud provider for the rule.
description String
Description for rule.
id String
The provider-assigned unique ID for this managed resource.
name String
Name of the rule.
ruleId String
Id of rule.
rulesYaml String
Policy YAML of the rule.
cloudProvider string
The cloud provider for the rule.
description string
Description for rule.
id string
The provider-assigned unique ID for this managed resource.
name string
Name of the rule.
ruleId string
Id of rule.
rulesYaml string
Policy YAML of the rule.
cloud_provider str
The cloud provider for the rule.
description str
Description for rule.
id str
The provider-assigned unique ID for this managed resource.
name str
Name of the rule.
rule_id str
Id of rule.
rules_yaml str
Policy YAML of the rule.
cloudProvider String
The cloud provider for the rule.
description String
Description for rule.
id String
The provider-assigned unique ID for this managed resource.
name String
Name of the rule.
ruleId String
Id of rule.
rulesYaml String
Policy YAML of the rule.

Package Details

Repository
harness pulumi/pulumi-harness
License
Apache-2.0
Notes
This Pulumi package is based on the harness Terraform Provider.
Harness v0.7.2 published on Tuesday, Apr 15, 2025 by Pulumi