1. Packages
  2. Buildkite
  3. API Docs
  4. Cluster
  5. Cluster
Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse

buildkite.Cluster.Cluster

Explore with Pulumi AI

buildkite logo
Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse

    This resource allows you to create and manage a Buildkite Cluster to run your builds in. Clusters are useful for grouping agents by there capabilities or permissions. Find out more information in our documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as buildkite from "@pulumiverse/buildkite";
    
    // create a cluster
    const primary = new buildkite.cluster.Cluster("primary", {
        description: "Runs the monolith build and deploy",
        emoji: "πŸš€",
        color: "#bada55",
    });
    // add a pipeline to the cluster
    const monolith = new buildkite.pipeline.Pipeline("monolith", {
        repository: "https://github.com/...",
        clusterId: primary.id,
    });
    const _default = new buildkite.cluster.ClusterQueue("default", {
        clusterId: primary.id,
        key: "default",
    });
    
    import pulumi
    import pulumiverse_buildkite as buildkite
    
    # create a cluster
    primary = buildkite.cluster.Cluster("primary",
        description="Runs the monolith build and deploy",
        emoji="πŸš€",
        color="#bada55")
    # add a pipeline to the cluster
    monolith = buildkite.pipeline.Pipeline("monolith",
        repository="https://github.com/...",
        cluster_id=primary.id)
    default = buildkite.cluster.ClusterQueue("default",
        cluster_id=primary.id,
        key="default")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/Cluster"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/Pipeline"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// create a cluster
    		primary, err := Cluster.NewCluster(ctx, "primary", &Cluster.ClusterArgs{
    			Description: pulumi.String("Runs the monolith build and deploy"),
    			Emoji:       pulumi.String("πŸš€"),
    			Color:       pulumi.String("#bada55"),
    		})
    		if err != nil {
    			return err
    		}
    		// add a pipeline to the cluster
    		_, err = Pipeline.NewPipeline(ctx, "monolith", &Pipeline.PipelineArgs{
    			Repository: pulumi.String("https://github.com/..."),
    			ClusterId:  primary.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = Cluster.NewClusterQueue(ctx, "default", &Cluster.ClusterQueueArgs{
    			ClusterId: primary.ID(),
    			Key:       pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Buildkite = Pulumiverse.Buildkite;
    
    return await Deployment.RunAsync(() => 
    {
        // create a cluster
        var primary = new Buildkite.Cluster.Cluster("primary", new()
        {
            Description = "Runs the monolith build and deploy",
            Emoji = "πŸš€",
            Color = "#bada55",
        });
    
        // add a pipeline to the cluster
        var monolith = new Buildkite.Pipeline.Pipeline("monolith", new()
        {
            Repository = "https://github.com/...",
            ClusterId = primary.Id,
        });
    
        var @default = new Buildkite.Cluster.ClusterQueue("default", new()
        {
            ClusterId = primary.Id,
            Key = "default",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.buildkite.Cluster.Cluster;
    import com.pulumi.buildkite.Cluster.ClusterArgs;
    import com.pulumi.buildkite.Pipeline.Pipeline;
    import com.pulumi.buildkite.Pipeline.PipelineArgs;
    import com.pulumi.buildkite.Cluster.ClusterQueue;
    import com.pulumi.buildkite.Cluster.ClusterQueueArgs;
    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 primary = new Cluster("primary", ClusterArgs.builder()        
                .description("Runs the monolith build and deploy")
                .emoji("πŸš€")
                .color("#bada55")
                .build());
    
            var monolith = new Pipeline("monolith", PipelineArgs.builder()        
                .repository("https://github.com/...")
                .clusterId(primary.id())
                .build());
    
            var default_ = new ClusterQueue("default", ClusterQueueArgs.builder()        
                .clusterId(primary.id())
                .key("default")
                .build());
    
        }
    }
    
    resources:
      # create a cluster
      primary:
        type: buildkite:Cluster:Cluster
        properties:
          description: Runs the monolith build and deploy
          emoji: "\U0001F680"
          color: '#bada55'
      # add a pipeline to the cluster
      monolith:
        type: buildkite:Pipeline:Pipeline
        properties:
          repository: https://github.com/...
          clusterId: ${primary.id}
      default:
        type: buildkite:Cluster:ClusterQueue
        properties:
          clusterId: ${primary.id}
          key: default
    

    Create Cluster Resource

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

    Constructor syntax

    new Cluster(name: string, args?: ClusterArgs, opts?: CustomResourceOptions);
    @overload
    def Cluster(resource_name: str,
                args: Optional[ClusterArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Cluster(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                color: Optional[str] = None,
                description: Optional[str] = None,
                emoji: Optional[str] = None,
                name: Optional[str] = None)
    func NewCluster(ctx *Context, name string, args *ClusterArgs, opts ...ResourceOption) (*Cluster, error)
    public Cluster(string name, ClusterArgs? args = null, CustomResourceOptions? opts = null)
    public Cluster(String name, ClusterArgs args)
    public Cluster(String name, ClusterArgs args, CustomResourceOptions options)
    
    type: buildkite:Cluster:Cluster
    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 ClusterArgs
    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 ClusterArgs
    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 ClusterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterArgs
    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 clusterResource = new Buildkite.Cluster.Cluster("clusterResource", new()
    {
        Color = "string",
        Description = "string",
        Emoji = "string",
        Name = "string",
    });
    
    example, err := Cluster.NewCluster(ctx, "clusterResource", &Cluster.ClusterArgs{
    	Color:       pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Emoji:       pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var clusterResource = new Cluster("clusterResource", ClusterArgs.builder()
        .color("string")
        .description("string")
        .emoji("string")
        .name("string")
        .build());
    
    cluster_resource = buildkite.cluster.Cluster("clusterResource",
        color="string",
        description="string",
        emoji="string",
        name="string")
    
    const clusterResource = new buildkite.cluster.Cluster("clusterResource", {
        color: "string",
        description: "string",
        emoji: "string",
        name: "string",
    });
    
    type: buildkite:Cluster:Cluster
    properties:
        color: string
        description: string
        emoji: string
        name: string
    

    Cluster Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Cluster resource accepts the following input properties:

    Color string
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    Description string
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    Emoji string
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    Name string
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    Color string
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    Description string
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    Emoji string
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    Name string
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    color String
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description String
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji String
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name String
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    color string
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description string
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji string
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name string
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    color str
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description str
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji str
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name str
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    color String
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description String
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji String
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name String
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    The UUID of the cluster.
    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    The UUID of the cluster.
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    The UUID of the cluster.
    id string
    The provider-assigned unique ID for this managed resource.
    uuid string
    The UUID of the cluster.
    id str
    The provider-assigned unique ID for this managed resource.
    uuid str
    The UUID of the cluster.
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    The UUID of the cluster.

    Look up Existing Cluster Resource

    Get an existing Cluster 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?: ClusterState, opts?: CustomResourceOptions): Cluster
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            color: Optional[str] = None,
            description: Optional[str] = None,
            emoji: Optional[str] = None,
            name: Optional[str] = None,
            uuid: Optional[str] = None) -> Cluster
    func GetCluster(ctx *Context, name string, id IDInput, state *ClusterState, opts ...ResourceOption) (*Cluster, error)
    public static Cluster Get(string name, Input<string> id, ClusterState? state, CustomResourceOptions? opts = null)
    public static Cluster get(String name, Output<String> id, ClusterState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Color string
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    Description string
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    Emoji string
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    Name string
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    Uuid string
    The UUID of the cluster.
    Color string
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    Description string
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    Emoji string
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    Name string
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    Uuid string
    The UUID of the cluster.
    color String
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description String
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji String
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name String
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    uuid String
    The UUID of the cluster.
    color string
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description string
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji string
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name string
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    uuid string
    The UUID of the cluster.
    color str
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description str
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji str
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name str
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    uuid str
    The UUID of the cluster.
    color String
    A color representation of the Cluster. Accepts hex codes, eg #BADA55.
    description String
    This is a description for the cluster, this may describe the usage for it, the region, or something else which would help identify the Cluster's purpose.
    emoji String
    An emoji to use with the Cluster, this can either be set using :buildkite: notation, or with the emoji itself, such as πŸš€.
    name String
    The name of the Cluster. Can only contain numbers and letters, no spaces or special characters.
    uuid String
    The UUID of the cluster.

    Import

    import a cluster resource using the GraphQL ID

    you can use this query to find the ID:

    query getClusters {

    organization(slug: “ORGANIZATION”){

    clusters(first: 5, order:NAME) {
    
      edges{
    
        node {
    
          id
    
          name
    
        }
    
      }
    
    }
    

    }

    }

    $ pulumi import buildkite:Cluster/cluster:Cluster primary Q2x1c3Rlci0tLTI3ZmFmZjA4LTA3OWEtNDk5ZC1hMmIwLTIzNmY3NWFkMWZjYg==
    

    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
    Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse