published on Monday, Feb 23, 2026 by Pulumiverse
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.
An Organization Rule allows specifying explicit rules between two Buildkite resources and the desired effect/action.
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";
// Creates a TRIGGER_BUILD organization rule with required attributes
const triggerBuildTestDev = new buildkite.organization.Rule("trigger_build_test_dev", {
type: "pipeline.trigger_build.pipeline",
value: JSON.stringify({
source_pipeline: appDevDeploy.uuid,
target_pipeline: appTestCi.uuid,
}),
});
// Creates a ARTIFACTS_READ organization rule with an optional description
const artifactsReadTestDev = new buildkite.organization.Rule("artifacts_read_test_dev", {
type: "pipeline.artifacts_read.pipeline",
description: "A rule to allow artifact reads by app_test_ci to app_dev_deploy",
value: JSON.stringify({
source_pipeline: appTestCi.uuid,
target_pipeline: appDevDeploy.uuid,
}),
});
// Creates a TRIGGER_BUILD organization rule with an optional description and conditions
const triggerBuildTestDevCond = new buildkite.organization.Rule("trigger_build_test_dev_cond", {
type: "pipeline.trigger_build.pipeline",
description: "A rule to allow app_dev_deploy to trigger app_test_ci builds with conditions",
value: JSON.stringify({
source_pipeline: appDevDeploy.uuid,
target_pipeline: appTestCi.uuid,
conditions: [
"source.build.creator.teams includes 'deploy'",
"source.build.branch == 'main'",
],
}),
});
import pulumi
import json
import pulumiverse_buildkite as buildkite
# Creates a TRIGGER_BUILD organization rule with required attributes
trigger_build_test_dev = buildkite.organization.Rule("trigger_build_test_dev",
type="pipeline.trigger_build.pipeline",
value=json.dumps({
"source_pipeline": app_dev_deploy["uuid"],
"target_pipeline": app_test_ci["uuid"],
}))
# Creates a ARTIFACTS_READ organization rule with an optional description
artifacts_read_test_dev = buildkite.organization.Rule("artifacts_read_test_dev",
type="pipeline.artifacts_read.pipeline",
description="A rule to allow artifact reads by app_test_ci to app_dev_deploy",
value=json.dumps({
"source_pipeline": app_test_ci["uuid"],
"target_pipeline": app_dev_deploy["uuid"],
}))
# Creates a TRIGGER_BUILD organization rule with an optional description and conditions
trigger_build_test_dev_cond = buildkite.organization.Rule("trigger_build_test_dev_cond",
type="pipeline.trigger_build.pipeline",
description="A rule to allow app_dev_deploy to trigger app_test_ci builds with conditions",
value=json.dumps({
"source_pipeline": app_dev_deploy["uuid"],
"target_pipeline": app_test_ci["uuid"],
"conditions": [
"source.build.creator.teams includes 'deploy'",
"source.build.branch == 'main'",
],
}))
package main
import (
"encoding/json"
"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 {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"source_pipeline": appDevDeploy.Uuid,
"target_pipeline": appTestCi.Uuid,
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
// Creates a TRIGGER_BUILD organization rule with required attributes
_, err = organization.NewRule(ctx, "trigger_build_test_dev", &organization.RuleArgs{
Type: pulumi.String("pipeline.trigger_build.pipeline"),
Value: pulumi.String(json0),
})
if err != nil {
return err
}
tmpJSON1, err := json.Marshal(map[string]interface{}{
"source_pipeline": appTestCi.Uuid,
"target_pipeline": appDevDeploy.Uuid,
})
if err != nil {
return err
}
json1 := string(tmpJSON1)
// Creates a ARTIFACTS_READ organization rule with an optional description
_, err = organization.NewRule(ctx, "artifacts_read_test_dev", &organization.RuleArgs{
Type: pulumi.String("pipeline.artifacts_read.pipeline"),
Description: pulumi.String("A rule to allow artifact reads by app_test_ci to app_dev_deploy"),
Value: pulumi.String(json1),
})
if err != nil {
return err
}
tmpJSON2, err := json.Marshal(map[string]interface{}{
"source_pipeline": appDevDeploy.Uuid,
"target_pipeline": appTestCi.Uuid,
"conditions": []string{
"source.build.creator.teams includes 'deploy'",
"source.build.branch == 'main'",
},
})
if err != nil {
return err
}
json2 := string(tmpJSON2)
// Creates a TRIGGER_BUILD organization rule with an optional description and conditions
_, err = organization.NewRule(ctx, "trigger_build_test_dev_cond", &organization.RuleArgs{
Type: pulumi.String("pipeline.trigger_build.pipeline"),
Description: pulumi.String("A rule to allow app_dev_deploy to trigger app_test_ci builds with conditions"),
Value: pulumi.String(json2),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Buildkite = Pulumiverse.Buildkite;
return await Deployment.RunAsync(() =>
{
// Creates a TRIGGER_BUILD organization rule with required attributes
var triggerBuildTestDev = new Buildkite.Organization.Rule("trigger_build_test_dev", new()
{
Type = "pipeline.trigger_build.pipeline",
Value = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["source_pipeline"] = appDevDeploy.Uuid,
["target_pipeline"] = appTestCi.Uuid,
}),
});
// Creates a ARTIFACTS_READ organization rule with an optional description
var artifactsReadTestDev = new Buildkite.Organization.Rule("artifacts_read_test_dev", new()
{
Type = "pipeline.artifacts_read.pipeline",
Description = "A rule to allow artifact reads by app_test_ci to app_dev_deploy",
Value = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["source_pipeline"] = appTestCi.Uuid,
["target_pipeline"] = appDevDeploy.Uuid,
}),
});
// Creates a TRIGGER_BUILD organization rule with an optional description and conditions
var triggerBuildTestDevCond = new Buildkite.Organization.Rule("trigger_build_test_dev_cond", new()
{
Type = "pipeline.trigger_build.pipeline",
Description = "A rule to allow app_dev_deploy to trigger app_test_ci builds with conditions",
Value = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["source_pipeline"] = appDevDeploy.Uuid,
["target_pipeline"] = appTestCi.Uuid,
["conditions"] = new[]
{
"source.build.creator.teams includes 'deploy'",
"source.build.branch == 'main'",
},
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.buildkite.Organization.Rule;
import com.pulumi.buildkite.Organization.RuleArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
// Creates a TRIGGER_BUILD organization rule with required attributes
var triggerBuildTestDev = new Rule("triggerBuildTestDev", RuleArgs.builder()
.type("pipeline.trigger_build.pipeline")
.value(serializeJson(
jsonObject(
jsonProperty("source_pipeline", appDevDeploy.uuid()),
jsonProperty("target_pipeline", appTestCi.uuid())
)))
.build());
// Creates a ARTIFACTS_READ organization rule with an optional description
var artifactsReadTestDev = new Rule("artifactsReadTestDev", RuleArgs.builder()
.type("pipeline.artifacts_read.pipeline")
.description("A rule to allow artifact reads by app_test_ci to app_dev_deploy")
.value(serializeJson(
jsonObject(
jsonProperty("source_pipeline", appTestCi.uuid()),
jsonProperty("target_pipeline", appDevDeploy.uuid())
)))
.build());
// Creates a TRIGGER_BUILD organization rule with an optional description and conditions
var triggerBuildTestDevCond = new Rule("triggerBuildTestDevCond", RuleArgs.builder()
.type("pipeline.trigger_build.pipeline")
.description("A rule to allow app_dev_deploy to trigger app_test_ci builds with conditions")
.value(serializeJson(
jsonObject(
jsonProperty("source_pipeline", appDevDeploy.uuid()),
jsonProperty("target_pipeline", appTestCi.uuid()),
jsonProperty("conditions", jsonArray(
"source.build.creator.teams includes 'deploy'",
"source.build.branch == 'main'"
))
)))
.build());
}
}
resources:
# Creates a TRIGGER_BUILD organization rule with required attributes
triggerBuildTestDev:
type: buildkite:Organization:Rule
name: trigger_build_test_dev
properties:
type: pipeline.trigger_build.pipeline
value:
fn::toJSON:
source_pipeline: ${appDevDeploy.uuid}
target_pipeline: ${appTestCi.uuid}
# Creates a ARTIFACTS_READ organization rule with an optional description
artifactsReadTestDev:
type: buildkite:Organization:Rule
name: artifacts_read_test_dev
properties:
type: pipeline.artifacts_read.pipeline
description: A rule to allow artifact reads by app_test_ci to app_dev_deploy
value:
fn::toJSON:
source_pipeline: ${appTestCi.uuid}
target_pipeline: ${appDevDeploy.uuid}
# Creates a TRIGGER_BUILD organization rule with an optional description and conditions
triggerBuildTestDevCond:
type: buildkite:Organization:Rule
name: trigger_build_test_dev_cond
properties:
type: pipeline.trigger_build.pipeline
description: A rule to allow app_dev_deploy to trigger app_test_ci builds with conditions
value:
fn::toJSON:
source_pipeline: ${appDevDeploy.uuid}
target_pipeline: ${appTestCi.uuid}
conditions:
- source.build.creator.teams includes 'deploy'
- source.build.branch == 'main'
Create Rule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);@overload
def Rule(resource_name: str,
args: RuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Rule(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
value: Optional[str] = None,
description: Optional[str] = None)func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)type: buildkite:Organization:Rule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var ruleResource = new Buildkite.Organization.Rule("ruleResource", new()
{
Type = "string",
Value = "string",
Description = "string",
});
example, err := organization.NewRule(ctx, "ruleResource", &organization.RuleArgs{
Type: pulumi.String("string"),
Value: pulumi.String("string"),
Description: pulumi.String("string"),
})
var ruleResource = new Rule("ruleResource", RuleArgs.builder()
.type("string")
.value("string")
.description("string")
.build());
rule_resource = buildkite.organization.Rule("ruleResource",
type="string",
value="string",
description="string")
const ruleResource = new buildkite.organization.Rule("ruleResource", {
type: "string",
value: "string",
description: "string",
});
type: buildkite:Organization:Rule
properties:
description: string
type: string
value: string
Rule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Rule resource accepts the following input properties:
- Type string
- The type of organization rule.
- Value string
- The JSON document that this organization rule implements.
- Description string
- The description of the organization rule.
- Type string
- The type of organization rule.
- Value string
- The JSON document that this organization rule implements.
- Description string
- The description of the organization rule.
- type String
- The type of organization rule.
- value String
- The JSON document that this organization rule implements.
- description String
- The description of the organization rule.
- type string
- The type of organization rule.
- value string
- The JSON document that this organization rule implements.
- description string
- The description of the organization rule.
- type str
- The type of organization rule.
- value str
- The JSON document that this organization rule implements.
- description str
- The description of the organization rule.
- type String
- The type of organization rule.
- value String
- The JSON document that this organization rule implements.
- description String
- The description of the organization rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:
- Action string
- The action defined between source and target resources.
- Effect string
- Whether this organization rule allows or denies the action to take place between source and target resources.
- Id string
- The provider-assigned unique ID for this managed resource.
- Source
Type string - The source resource type that this organization rule allows or denies to invoke its defined action.
- Source
Uuid string - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- Target
Type string - The target resource type that this organization rule allows or denies the source to respective action.
- Target
Uuid string - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- Uuid string
- The UUID of the organization rule.
- Action string
- The action defined between source and target resources.
- Effect string
- Whether this organization rule allows or denies the action to take place between source and target resources.
- Id string
- The provider-assigned unique ID for this managed resource.
- Source
Type string - The source resource type that this organization rule allows or denies to invoke its defined action.
- Source
Uuid string - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- Target
Type string - The target resource type that this organization rule allows or denies the source to respective action.
- Target
Uuid string - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- Uuid string
- The UUID of the organization rule.
- action String
- The action defined between source and target resources.
- effect String
- Whether this organization rule allows or denies the action to take place between source and target resources.
- id String
- The provider-assigned unique ID for this managed resource.
- source
Type String - The source resource type that this organization rule allows or denies to invoke its defined action.
- source
Uuid String - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- target
Type String - The target resource type that this organization rule allows or denies the source to respective action.
- target
Uuid String - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- uuid String
- The UUID of the organization rule.
- action string
- The action defined between source and target resources.
- effect string
- Whether this organization rule allows or denies the action to take place between source and target resources.
- id string
- The provider-assigned unique ID for this managed resource.
- source
Type string - The source resource type that this organization rule allows or denies to invoke its defined action.
- source
Uuid string - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- target
Type string - The target resource type that this organization rule allows or denies the source to respective action.
- target
Uuid string - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- uuid string
- The UUID of the organization rule.
- action str
- The action defined between source and target resources.
- effect str
- Whether this organization rule allows or denies the action to take place between source and target resources.
- id str
- The provider-assigned unique ID for this managed resource.
- 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 resource that this organization rule allows or denies invocation its respective action.
- uuid str
- The UUID of the organization rule.
- action String
- The action defined between source and target resources.
- effect String
- Whether this organization rule allows or denies the action to take place between source and target resources.
- id String
- The provider-assigned unique ID for this managed resource.
- source
Type String - The source resource type that this organization rule allows or denies to invoke its defined action.
- source
Uuid String - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- target
Type String - The target resource type that this organization rule allows or denies the source to respective action.
- target
Uuid String - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- uuid String
- The UUID of the organization rule.
Look up Existing Rule Resource
Get an existing Rule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RuleState, opts?: CustomResourceOptions): Rule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
description: Optional[str] = None,
effect: Optional[str] = None,
source_type: Optional[str] = None,
source_uuid: Optional[str] = None,
target_type: Optional[str] = None,
target_uuid: Optional[str] = None,
type: Optional[str] = None,
uuid: Optional[str] = None,
value: Optional[str] = None) -> Rulefunc GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)resources: _: type: buildkite:Organization:Rule get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- 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 denies the action to take place between source and target resources.
- Source
Type string - The source resource type that this organization rule allows or denies to invoke its defined action.
- Source
Uuid string - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- Target
Type string - The target resource type that this organization rule allows or denies the source to respective action.
- Target
Uuid string - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- Type string
- The type of organization rule.
- Uuid string
- The UUID of the organization rule.
- Value string
- The JSON document that this organization rule implements.
- 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 denies the action to take place between source and target resources.
- Source
Type string - The source resource type that this organization rule allows or denies to invoke its defined action.
- Source
Uuid string - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- Target
Type string - The target resource type that this organization rule allows or denies the source to respective action.
- Target
Uuid string - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- Type string
- The type of organization rule.
- Uuid string
- The UUID of the organization rule.
- Value string
- The JSON document that this organization rule implements.
- 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 denies the action to take place between source and target resources.
- source
Type String - The source resource type that this organization rule allows or denies to invoke its defined action.
- source
Uuid String - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- target
Type String - The target resource type that this organization rule allows or denies the source to respective action.
- target
Uuid String - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- type String
- The type of organization rule.
- uuid String
- The UUID of the organization rule.
- value String
- The JSON document that this organization rule implements.
- 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 denies the action to take place between source and target resources.
- source
Type string - The source resource type that this organization rule allows or denies to invoke its defined action.
- source
Uuid string - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- target
Type string - The target resource type that this organization rule allows or denies the source to respective action.
- target
Uuid string - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- type string
- The type of organization rule.
- uuid string
- The UUID of the organization rule.
- value string
- The JSON document that this organization rule implements.
- 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 denies 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 resource that this organization rule allows or denies invocation its respective action.
- type str
- The type of organization rule.
- uuid str
- The UUID of the organization rule.
- value str
- The JSON document that this organization rule implements.
- 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 denies the action to take place between source and target resources.
- source
Type String - The source resource type that this organization rule allows or denies to invoke its defined action.
- source
Uuid String - The UUID of the resource that this organization rule allows or denies invocating its defined action.
- target
Type String - The target resource type that this organization rule allows or denies the source to respective action.
- target
Uuid String - The UUID of the target resource that this organization rule allows or denies invocation its respective action.
- type String
- The type of organization rule.
- uuid String
- The UUID of the organization rule.
- value String
- The JSON document that this organization rule implements.
Import
Using pulumi import, import resources using the id. For example:
import an organization rule resource using the rules GraphQL ID
You can use this query to find the first 50 organiation rules (adjust for less or more):
query getOrganizationRules {
organization(slug: “ORGANIZATION_SLUG”) {
rules(first: 50) {
edges{
node{
id
sourceType
targetType
action
}
}
}
}
}
Depending on the speciific source/target, you’re also able to filter on the source/target information
query getOrganizationRules {
organization(slug: “ORGANIZATION_SLUG”) {
rules(first: 50) {
edges{
node{
id
sourceType
source {
... on Pipeline{
uuid
name
}
}
targetType
target {
... on Pipeline{
uuid
name
}
}
action
}
}
}
}
}
$ pulumi import buildkite:Organization/rule:Rule artifact_read UnVsZS0tLTAxOTE5NmU2LWNiNjctNzZiZi1iYzAyLTVhYzFiNzhhMWMyOA==
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- buildkite pulumiverse/pulumi-buildkite
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
buildkiteTerraform Provider.
published on Monday, Feb 23, 2026 by Pulumiverse
