1. Packages
  2. Buildkite
  3. API Docs
  4. Cluster
  5. ClusterSecret
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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as buildkite from "@pulumiverse/buildkite";
    
    const example = new buildkite.cluster.ClusterSecret("example", {
        clusterId: "01234567-89ab-cdef-0123-456789abcdef",
        key: "DATABASE_PASSWORD",
        value: "super-secret-password",
        description: "Production database password",
        policy: `- pipeline_slug: my-pipeline
      build_branch: main
    `,
    });
    
    import pulumi
    import pulumiverse_buildkite as buildkite
    
    example = buildkite.cluster.ClusterSecret("example",
        cluster_id="01234567-89ab-cdef-0123-456789abcdef",
        key="DATABASE_PASSWORD",
        value="super-secret-password",
        description="Production database password",
        policy="""- pipeline_slug: my-pipeline
      build_branch: main
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/cluster"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cluster.NewClusterSecret(ctx, "example", &cluster.ClusterSecretArgs{
    			ClusterId:   pulumi.String("01234567-89ab-cdef-0123-456789abcdef"),
    			Key:         pulumi.String("DATABASE_PASSWORD"),
    			Value:       pulumi.String("super-secret-password"),
    			Description: pulumi.String("Production database password"),
    			Policy:      pulumi.String("- pipeline_slug: my-pipeline\n  build_branch: main\n"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Buildkite = Pulumiverse.Buildkite;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Buildkite.Cluster.ClusterSecret("example", new()
        {
            ClusterId = "01234567-89ab-cdef-0123-456789abcdef",
            Key = "DATABASE_PASSWORD",
            Value = "super-secret-password",
            Description = "Production database password",
            Policy = @"- pipeline_slug: my-pipeline
      build_branch: main
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.buildkite.Cluster.ClusterSecret;
    import com.pulumi.buildkite.Cluster.ClusterSecretArgs;
    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) {
            var example = new ClusterSecret("example", ClusterSecretArgs.builder()
                .clusterId("01234567-89ab-cdef-0123-456789abcdef")
                .key("DATABASE_PASSWORD")
                .value("super-secret-password")
                .description("Production database password")
                .policy("""
    - pipeline_slug: my-pipeline
      build_branch: main
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: buildkite:Cluster:ClusterSecret
        properties:
          clusterId: 01234567-89ab-cdef-0123-456789abcdef
          key: DATABASE_PASSWORD
          value: super-secret-password
          description: Production database password
          policy: |
            - pipeline_slug: my-pipeline
              build_branch: main
    

    Create ClusterSecret Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClusterSecret(name: string, args: ClusterSecretArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterSecret(resource_name: str,
                      args: ClusterSecretArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClusterSecret(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      cluster_id: Optional[str] = None,
                      key: Optional[str] = None,
                      value: Optional[str] = None,
                      description: Optional[str] = None,
                      policy: Optional[str] = None)
    func NewClusterSecret(ctx *Context, name string, args ClusterSecretArgs, opts ...ResourceOption) (*ClusterSecret, error)
    public ClusterSecret(string name, ClusterSecretArgs args, CustomResourceOptions? opts = null)
    public ClusterSecret(String name, ClusterSecretArgs args)
    public ClusterSecret(String name, ClusterSecretArgs args, CustomResourceOptions options)
    
    type: buildkite:Cluster:ClusterSecret
    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 ClusterSecretArgs
    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 ClusterSecretArgs
    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 ClusterSecretArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterSecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterSecretArgs
    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 clusterSecretResource = new Buildkite.Cluster.ClusterSecret("clusterSecretResource", new()
    {
        ClusterId = "string",
        Key = "string",
        Value = "string",
        Description = "string",
        Policy = "string",
    });
    
    example, err := cluster.NewClusterSecret(ctx, "clusterSecretResource", &cluster.ClusterSecretArgs{
    	ClusterId:   pulumi.String("string"),
    	Key:         pulumi.String("string"),
    	Value:       pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Policy:      pulumi.String("string"),
    })
    
    var clusterSecretResource = new ClusterSecret("clusterSecretResource", ClusterSecretArgs.builder()
        .clusterId("string")
        .key("string")
        .value("string")
        .description("string")
        .policy("string")
        .build());
    
    cluster_secret_resource = buildkite.cluster.ClusterSecret("clusterSecretResource",
        cluster_id="string",
        key="string",
        value="string",
        description="string",
        policy="string")
    
    const clusterSecretResource = new buildkite.cluster.ClusterSecret("clusterSecretResource", {
        clusterId: "string",
        key: "string",
        value: "string",
        description: "string",
        policy: "string",
    });
    
    type: buildkite:Cluster:ClusterSecret
    properties:
        clusterId: string
        description: string
        key: string
        policy: string
        value: string
    

    ClusterSecret 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 ClusterSecret resource accepts the following input properties:

    ClusterId string
    The UUID of the cluster this secret belongs to.
    Key string
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    Value string
    The secret value. Must be less than 8KB.
    Description string
    A description of what this secret is for.
    Policy string
    YAML access policy defining which pipelines and branches can access this secret.
    ClusterId string
    The UUID of the cluster this secret belongs to.
    Key string
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    Value string
    The secret value. Must be less than 8KB.
    Description string
    A description of what this secret is for.
    Policy string
    YAML access policy defining which pipelines and branches can access this secret.
    clusterId String
    The UUID of the cluster this secret belongs to.
    key String
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    value String
    The secret value. Must be less than 8KB.
    description String
    A description of what this secret is for.
    policy String
    YAML access policy defining which pipelines and branches can access this secret.
    clusterId string
    The UUID of the cluster this secret belongs to.
    key string
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    value string
    The secret value. Must be less than 8KB.
    description string
    A description of what this secret is for.
    policy string
    YAML access policy defining which pipelines and branches can access this secret.
    cluster_id str
    The UUID of the cluster this secret belongs to.
    key str
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    value str
    The secret value. Must be less than 8KB.
    description str
    A description of what this secret is for.
    policy str
    YAML access policy defining which pipelines and branches can access this secret.
    clusterId String
    The UUID of the cluster this secret belongs to.
    key String
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    value String
    The secret value. Must be less than 8KB.
    description String
    A description of what this secret is for.
    policy String
    YAML access policy defining which pipelines and branches can access this secret.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClusterSecret resource produces the following output properties:

    CreatedAt string
    The time when the secret was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    The time when the secret was last updated.
    CreatedAt string
    The time when the secret was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    The time when the secret was last updated.
    createdAt String
    The time when the secret was created.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    The time when the secret was last updated.
    createdAt string
    The time when the secret was created.
    id string
    The provider-assigned unique ID for this managed resource.
    updatedAt string
    The time when the secret was last updated.
    created_at str
    The time when the secret was created.
    id str
    The provider-assigned unique ID for this managed resource.
    updated_at str
    The time when the secret was last updated.
    createdAt String
    The time when the secret was created.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    The time when the secret was last updated.

    Look up Existing ClusterSecret Resource

    Get an existing ClusterSecret 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?: ClusterSecretState, opts?: CustomResourceOptions): ClusterSecret
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            key: Optional[str] = None,
            policy: Optional[str] = None,
            updated_at: Optional[str] = None,
            value: Optional[str] = None) -> ClusterSecret
    func GetClusterSecret(ctx *Context, name string, id IDInput, state *ClusterSecretState, opts ...ResourceOption) (*ClusterSecret, error)
    public static ClusterSecret Get(string name, Input<string> id, ClusterSecretState? state, CustomResourceOptions? opts = null)
    public static ClusterSecret get(String name, Output<String> id, ClusterSecretState state, CustomResourceOptions options)
    resources:  _:    type: buildkite:Cluster:ClusterSecret    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.
    The following state arguments are supported:
    ClusterId string
    The UUID of the cluster this secret belongs to.
    CreatedAt string
    The time when the secret was created.
    Description string
    A description of what this secret is for.
    Key string
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    Policy string
    YAML access policy defining which pipelines and branches can access this secret.
    UpdatedAt string
    The time when the secret was last updated.
    Value string
    The secret value. Must be less than 8KB.
    ClusterId string
    The UUID of the cluster this secret belongs to.
    CreatedAt string
    The time when the secret was created.
    Description string
    A description of what this secret is for.
    Key string
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    Policy string
    YAML access policy defining which pipelines and branches can access this secret.
    UpdatedAt string
    The time when the secret was last updated.
    Value string
    The secret value. Must be less than 8KB.
    clusterId String
    The UUID of the cluster this secret belongs to.
    createdAt String
    The time when the secret was created.
    description String
    A description of what this secret is for.
    key String
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    policy String
    YAML access policy defining which pipelines and branches can access this secret.
    updatedAt String
    The time when the secret was last updated.
    value String
    The secret value. Must be less than 8KB.
    clusterId string
    The UUID of the cluster this secret belongs to.
    createdAt string
    The time when the secret was created.
    description string
    A description of what this secret is for.
    key string
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    policy string
    YAML access policy defining which pipelines and branches can access this secret.
    updatedAt string
    The time when the secret was last updated.
    value string
    The secret value. Must be less than 8KB.
    cluster_id str
    The UUID of the cluster this secret belongs to.
    created_at str
    The time when the secret was created.
    description str
    A description of what this secret is for.
    key str
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    policy str
    YAML access policy defining which pipelines and branches can access this secret.
    updated_at str
    The time when the secret was last updated.
    value str
    The secret value. Must be less than 8KB.
    clusterId String
    The UUID of the cluster this secret belongs to.
    createdAt String
    The time when the secret was created.
    description String
    A description of what this secret is for.
    key String
    The key name for the secret. Must start with a letter and only contain letters, numbers, and underscores. Maximum 255 characters.
    policy String
    YAML access policy defining which pipelines and branches can access this secret.
    updatedAt String
    The time when the secret was last updated.
    value String
    The secret value. Must be less than 8KB.

    Import

    Using pulumi import, import resources using the id. For example:

    Import a cluster secret using {cluster_id}/{secret_id}

    You can find the cluster_id under cluster settings in the UI

    and find the secret_id from the secrets list using the

    REST API response from:

    GET /v2/organizations/{org_slug}/clusters/{cluster_id}/secrets

    $ pulumi import buildkite:Cluster/clusterSecret:ClusterSecret example 01234567-89ab-cdef-0123-456789abcdef/fedcba98-7654-3210-fedc-ba9876543210
    

    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 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.