Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse
buildkite.Cluster.getCluster
Explore with Pulumi AI
Use this data source to retrieve a cluster by name. You can find out more about clusters in the Buildkite documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as buildkite from "@pulumi/buildkite";
import * as buildkite from "@pulumiverse/buildkite";
const default = buildkite.Cluster.getCluster({
name: "default",
});
// Assign a pipeline to that cluster
const terraform_provider_buildkite = new buildkite.pipeline.Pipeline("terraform-provider-buildkite", {
repository: "git@github.com:buildkite/terraform-provider-buildkite.git",
clusterId: _default.then(_default => _default.id),
});
import pulumi
import pulumi_buildkite as buildkite
import pulumiverse_buildkite as buildkite
default = buildkite.Cluster.get_cluster(name="default")
# Assign a pipeline to that cluster
terraform_provider_buildkite = buildkite.pipeline.Pipeline("terraform-provider-buildkite",
repository="git@github.com:buildkite/terraform-provider-buildkite.git",
cluster_id=default.id)
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 {
_default, err := Cluster.GetCluster(ctx, &cluster.GetClusterArgs{
Name: "default",
}, nil)
if err != nil {
return err
}
// Assign a pipeline to that cluster
_, err = Pipeline.NewPipeline(ctx, "terraform-provider-buildkite", &Pipeline.PipelineArgs{
Repository: pulumi.String("git@github.com:buildkite/terraform-provider-buildkite.git"),
ClusterId: *pulumi.String(_default.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Buildkite = Pulumi.Buildkite;
using Buildkite = Pulumiverse.Buildkite;
return await Deployment.RunAsync(() =>
{
var @default = Buildkite.Cluster.GetCluster.Invoke(new()
{
Name = "default",
});
// Assign a pipeline to that cluster
var terraform_provider_buildkite = new Buildkite.Pipeline.Pipeline("terraform-provider-buildkite", new()
{
Repository = "git@github.com:buildkite/terraform-provider-buildkite.git",
ClusterId = @default.Apply(@default => @default.Apply(getClusterResult => getClusterResult.Id)),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.buildkite.Cluster.ClusterFunctions;
import com.pulumi.buildkite.Cluster.inputs.GetClusterArgs;
import com.pulumi.buildkite.Pipeline.Pipeline;
import com.pulumi.buildkite.Pipeline.PipelineArgs;
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 default = ClusterFunctions.getCluster(GetClusterArgs.builder()
.name("default")
.build());
var terraform_provider_buildkite = new Pipeline("terraform-provider-buildkite", PipelineArgs.builder()
.repository("git@github.com:buildkite/terraform-provider-buildkite.git")
.clusterId(default_.id())
.build());
}
}
resources:
# Assign a pipeline to that cluster
terraform-provider-buildkite:
type: buildkite:Pipeline:Pipeline
properties:
repository: git@github.com:buildkite/terraform-provider-buildkite.git
clusterId: ${default.id}
variables:
default:
fn::invoke:
Function: buildkite:Cluster:getCluster
Arguments:
name: default
Using getCluster
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 getCluster(args: GetClusterArgs, opts?: InvokeOptions): Promise<GetClusterResult>
function getClusterOutput(args: GetClusterOutputArgs, opts?: InvokeOptions): Output<GetClusterResult>
def get_cluster(name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetClusterResult
def get_cluster_output(name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetClusterResult]
func GetCluster(ctx *Context, args *GetClusterArgs, opts ...InvokeOption) (*GetClusterResult, error)
func GetClusterOutput(ctx *Context, args *GetClusterOutputArgs, opts ...InvokeOption) GetClusterResultOutput
> Note: This function is named GetCluster
in the Go SDK.
public static class GetCluster
{
public static Task<GetClusterResult> InvokeAsync(GetClusterArgs args, InvokeOptions? opts = null)
public static Output<GetClusterResult> Invoke(GetClusterInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetClusterResult> getCluster(GetClusterArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: buildkite:Cluster/getCluster:getCluster
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of the cluster to retrieve.
- Name string
- The name of the cluster to retrieve.
- name String
- The name of the cluster to retrieve.
- name string
- The name of the cluster to retrieve.
- name str
- The name of the cluster to retrieve.
- name String
- The name of the cluster to retrieve.
getCluster Result
The following output properties are available:
Package Details
- Repository
- buildkite pulumiverse/pulumi-buildkite
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
buildkite
Terraform Provider.