1. Packages
  2. Harness Provider
  3. API Docs
  4. governance
  5. getRule
Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi

harness.governance.getRule

Explore with Pulumi AI

harness logo
Harness v0.4.4 published on Tuesday, Nov 12, 2024 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",
    });
    
    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: harness:governance/getRule:getRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RuleId string
    Id of rule.
    RuleId string
    Id of rule.
    ruleId String
    Id of rule.
    ruleId string
    Id of rule.
    rule_id str
    Id of rule.
    ruleId 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 logo
    Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi