1. Packages
  2. Buildkite
  3. API Docs
  4. Organization
  5. getRule
Viewing docs for Buildkite v3.2.0
published on Monday, Feb 23, 2026 by Pulumiverse
buildkite logo
Viewing docs for Buildkite v3.2.0
published on Monday, Feb 23, 2026 by Pulumiverse

    Rules is a feature that is currently in development and enabled on an opt-in basis for early access. To have this enabled for your organization for utilizing this data source, please reach out to Buildkite’s Support Team.

    Use this data source to retrieve an organization rule by its ID.

    More information on organization rules can be found in the documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as buildkite from "@pulumiverse/buildkite";
    
    // Read an organization rule by its id
    const dataArtifactsReadDevTest = buildkite.Organization.getRule({
        id: artifactsReadDevTest.id,
    });
    // Read an organization rule by its uuid
    const dataArtifactsReadTestDev = buildkite.Organization.getRule({
        uuid: artifactsReadTestDev.uuid,
    });
    
    import pulumi
    import pulumi_buildkite as buildkite
    
    # Read an organization rule by its id
    data_artifacts_read_dev_test = buildkite.Organization.get_rule(id=artifacts_read_dev_test["id"])
    # Read an organization rule by its uuid
    data_artifacts_read_test_dev = buildkite.Organization.get_rule(uuid=artifacts_read_test_dev["uuid"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/organization"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Read an organization rule by its id
    		_, err := organization.GetRule(ctx, &organization.GetRuleArgs{
    			Id: pulumi.StringRef(artifactsReadDevTest.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Read an organization rule by its uuid
    		_, err = organization.GetRule(ctx, &organization.GetRuleArgs{
    			Uuid: pulumi.StringRef(artifactsReadTestDev.Uuid),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Buildkite = Pulumiverse.Buildkite;
    
    return await Deployment.RunAsync(() => 
    {
        // Read an organization rule by its id
        var dataArtifactsReadDevTest = Buildkite.Organization.GetRule.Invoke(new()
        {
            Id = artifactsReadDevTest.Id,
        });
    
        // Read an organization rule by its uuid
        var dataArtifactsReadTestDev = Buildkite.Organization.GetRule.Invoke(new()
        {
            Uuid = artifactsReadTestDev.Uuid,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.buildkite.Organization.OrganizationFunctions;
    import com.pulumi.buildkite.Organization.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) {
            // Read an organization rule by its id
            final var dataArtifactsReadDevTest = OrganizationFunctions.getRule(GetRuleArgs.builder()
                .id(artifactsReadDevTest.id())
                .build());
    
            // Read an organization rule by its uuid
            final var dataArtifactsReadTestDev = OrganizationFunctions.getRule(GetRuleArgs.builder()
                .uuid(artifactsReadTestDev.uuid())
                .build());
    
        }
    }
    
    variables:
      # Read an organization rule by its id
      dataArtifactsReadDevTest:
        fn::invoke:
          function: buildkite:Organization:getRule
          arguments:
            id: ${artifactsReadDevTest.id}
      # Read an organization rule by its uuid
      dataArtifactsReadTestDev:
        fn::invoke:
          function: buildkite:Organization:getRule
          arguments:
            uuid: ${artifactsReadTestDev.uuid}
    

    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(id: Optional[str] = None,
                 uuid: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRuleResult
    def get_rule_output(id: Optional[pulumi.Input[str]] = None,
                 uuid: 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: buildkite:Organization/getRule:getRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The GraphQL ID of the organization rule.
    Uuid string
    The UUID of the organization rule.
    Id string
    The GraphQL ID of the organization rule.
    Uuid string
    The UUID of the organization rule.
    id String
    The GraphQL ID of the organization rule.
    uuid String
    The UUID of the organization rule.
    id string
    The GraphQL ID of the organization rule.
    uuid string
    The UUID of the organization rule.
    id str
    The GraphQL ID of the organization rule.
    uuid str
    The UUID of the organization rule.
    id String
    The GraphQL ID of the organization rule.
    uuid String
    The UUID of the organization rule.

    getRule Result

    The following output properties are available:

    Action string
    The action defined between source and target resources.
    Description string
    The description of the organization rule.
    Effect string
    Whether this organization rule allows or denys the action to take place between source and target resources.
    SourceType string
    The source resource type that this organization rule allows or denies to invoke its defined action.
    SourceUuid string
    The UUID of the resource that this organization rule allows or denies invocating its defined action.
    TargetType string
    The target resource type that this organization rule allows or denies the source to respective action.
    TargetUuid string
    The UUID of the target resourcee that this organization rule allows or denies invocation its respective action.
    Type string
    The type of organization rule.
    Value string
    The JSON document that this organization rule implements.
    Id string
    The GraphQL ID of the organization rule.
    Uuid string
    The UUID of the organization rule.
    Action string
    The action defined between source and target resources.
    Description string
    The description of the organization rule.
    Effect string
    Whether this organization rule allows or denys the action to take place between source and target resources.
    SourceType string
    The source resource type that this organization rule allows or denies to invoke its defined action.
    SourceUuid string
    The UUID of the resource that this organization rule allows or denies invocating its defined action.
    TargetType string
    The target resource type that this organization rule allows or denies the source to respective action.
    TargetUuid string
    The UUID of the target resourcee that this organization rule allows or denies invocation its respective action.
    Type string
    The type of organization rule.
    Value string
    The JSON document that this organization rule implements.
    Id string
    The GraphQL ID of the organization rule.
    Uuid string
    The UUID of the organization rule.
    action String
    The action defined between source and target resources.
    description String
    The description of the organization rule.
    effect String
    Whether this organization rule allows or denys the action to take place between source and target resources.
    sourceType String
    The source resource type that this organization rule allows or denies to invoke its defined action.
    sourceUuid String
    The UUID of the resource that this organization rule allows or denies invocating its defined action.
    targetType String
    The target resource type that this organization rule allows or denies the source to respective action.
    targetUuid String
    The UUID of the target resourcee that this organization rule allows or denies invocation its respective action.
    type String
    The type of organization rule.
    value String
    The JSON document that this organization rule implements.
    id String
    The GraphQL ID of the organization rule.
    uuid String
    The UUID of the organization rule.
    action string
    The action defined between source and target resources.
    description string
    The description of the organization rule.
    effect string
    Whether this organization rule allows or denys the action to take place between source and target resources.
    sourceType string
    The source resource type that this organization rule allows or denies to invoke its defined action.
    sourceUuid string
    The UUID of the resource that this organization rule allows or denies invocating its defined action.
    targetType string
    The target resource type that this organization rule allows or denies the source to respective action.
    targetUuid string
    The UUID of the target resourcee that this organization rule allows or denies invocation its respective action.
    type string
    The type of organization rule.
    value string
    The JSON document that this organization rule implements.
    id string
    The GraphQL ID of the organization rule.
    uuid string
    The UUID of the organization rule.
    action str
    The action defined between source and target resources.
    description str
    The description of the organization rule.
    effect str
    Whether this organization rule allows or denys the action to take place between source and target resources.
    source_type str
    The source resource type that this organization rule allows or denies to invoke its defined action.
    source_uuid str
    The UUID of the resource that this organization rule allows or denies invocating its defined action.
    target_type str
    The target resource type that this organization rule allows or denies the source to respective action.
    target_uuid str
    The UUID of the target resourcee that this organization rule allows or denies invocation its respective action.
    type str
    The type of organization rule.
    value str
    The JSON document that this organization rule implements.
    id str
    The GraphQL ID of the organization rule.
    uuid str
    The UUID of the organization rule.
    action String
    The action defined between source and target resources.
    description String
    The description of the organization rule.
    effect String
    Whether this organization rule allows or denys the action to take place between source and target resources.
    sourceType String
    The source resource type that this organization rule allows or denies to invoke its defined action.
    sourceUuid String
    The UUID of the resource that this organization rule allows or denies invocating its defined action.
    targetType String
    The target resource type that this organization rule allows or denies the source to respective action.
    targetUuid String
    The UUID of the target resourcee that this organization rule allows or denies invocation its respective action.
    type String
    The type of organization rule.
    value String
    The JSON document that this organization rule implements.
    id String
    The GraphQL ID of the organization rule.
    uuid String
    The UUID of the organization rule.

    Package Details

    Repository
    buildkite pulumiverse/pulumi-buildkite
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the buildkite Terraform Provider.
    buildkite logo
    Viewing docs for Buildkite v3.2.0
    published on Monday, Feb 23, 2026 by Pulumiverse
      Try Pulumi Cloud free. Your team will thank you.