Harness v0.7.0 published on Friday, Mar 28, 2025 by Pulumi
harness.governance.getRule
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_harness as harness
example = harness.governance.get_rule(rule_id="rule_id")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: harness:governance:getRule
      arguments:
        ruleId: rule_id
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>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]func LookupRule(ctx *Context, args *LookupRuleArgs, opts ...InvokeOption) (*LookupRuleResult, error)
func LookupRuleOutput(ctx *Context, args *LookupRuleOutputArgs, opts ...InvokeOption) LookupRuleResultOutput> 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)
}public static CompletableFuture<GetRuleResult> getRule(GetRuleArgs args, InvokeOptions options)
public static Output<GetRuleResult> getRule(GetRuleArgs args, InvokeOptions options)
fn::invoke:
  function: harness:governance/getRule:getRule
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Rule
Id string - Id of rule.
 
- Rule
Id string - Id of rule.
 
- rule
Id String - Id of rule.
 
- rule
Id string - Id of rule.
 
- rule_
id str - Id of rule.
 
- rule
Id String - Id of rule.
 
getRule Result
The following output properties are available:
- Cloud
Provider 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.
 - Rule
Id string - Id of rule.
 - Rules
Yaml string - Policy YAML of the rule.
 
- Cloud
Provider 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.
 - Rule
Id string - Id of rule.
 - Rules
Yaml string - Policy YAML of the rule.
 
- cloud
Provider 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.
 - rule
Id String - Id of rule.
 - rules
Yaml String - Policy YAML of the rule.
 
- cloud
Provider 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.
 - rule
Id string - Id of rule.
 - rules
Yaml 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.
 
- cloud
Provider 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.
 - rule
Id String - Id of rule.
 - rules
Yaml 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 
harnessTerraform Provider.