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

buildkite.Pipeline.Team

Explore with Pulumi AI

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

    Manage team access to a pipeline.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as buildkite from "@pulumiverse/buildkite";
    
    const pipeline = new buildkite.pipeline.Pipeline("pipeline", {repository: "https://github.com/..."});
    const team = new buildkite.team.Team("team", {
        privacy: "VISIBLE",
        defaultTeam: false,
        defaultMemberRole: "MEMBER",
    });
    // allow everyone in the "Everyone" team read-only access to pipeline
    const pipelineTeam = new buildkite.pipeline.Team("pipelineTeam", {
        pipelineId: pipeline.id,
        teamId: team.id,
        accessLevel: "READ_ONLY",
    });
    
    import pulumi
    import pulumiverse_buildkite as buildkite
    
    pipeline = buildkite.pipeline.Pipeline("pipeline", repository="https://github.com/...")
    team = buildkite.team.Team("team",
        privacy="VISIBLE",
        default_team=False,
        default_member_role="MEMBER")
    # allow everyone in the "Everyone" team read-only access to pipeline
    pipeline_team = buildkite.pipeline.Team("pipelineTeam",
        pipeline_id=pipeline.id,
        team_id=team.id,
        access_level="READ_ONLY")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/Pipeline"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/Team"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pipeline, err := Pipeline.NewPipeline(ctx, "pipeline", &Pipeline.PipelineArgs{
    			Repository: pulumi.String("https://github.com/..."),
    		})
    		if err != nil {
    			return err
    		}
    		team, err := Team.NewTeam(ctx, "team", &Team.TeamArgs{
    			Privacy:           pulumi.String("VISIBLE"),
    			DefaultTeam:       pulumi.Bool(false),
    			DefaultMemberRole: pulumi.String("MEMBER"),
    		})
    		if err != nil {
    			return err
    		}
    		// allow everyone in the "Everyone" team read-only access to pipeline
    		_, err = Pipeline.NewTeam(ctx, "pipelineTeam", &Pipeline.TeamArgs{
    			PipelineId:  pipeline.ID(),
    			TeamId:      team.ID(),
    			AccessLevel: pulumi.String("READ_ONLY"),
    		})
    		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 pipeline = new Buildkite.Pipeline.Pipeline("pipeline", new()
        {
            Repository = "https://github.com/...",
        });
    
        var team = new Buildkite.Team.Team("team", new()
        {
            Privacy = "VISIBLE",
            DefaultTeam = false,
            DefaultMemberRole = "MEMBER",
        });
    
        // allow everyone in the "Everyone" team read-only access to pipeline
        var pipelineTeam = new Buildkite.Pipeline.Team("pipelineTeam", new()
        {
            PipelineId = pipeline.Id,
            TeamId = team.Id,
            AccessLevel = "READ_ONLY",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.buildkite.Pipeline.Pipeline;
    import com.pulumi.buildkite.Pipeline.PipelineArgs;
    import com.pulumi.buildkite.Team.Team;
    import com.pulumi.buildkite.Team.TeamArgs;
    import com.pulumi.buildkite.Pipeline.Team;
    import com.pulumi.buildkite.Pipeline.TeamArgs;
    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 pipeline = new Pipeline("pipeline", PipelineArgs.builder()        
                .repository("https://github.com/...")
                .build());
    
            var team = new Team("team", TeamArgs.builder()        
                .privacy("VISIBLE")
                .defaultTeam(false)
                .defaultMemberRole("MEMBER")
                .build());
    
            var pipelineTeam = new Team("pipelineTeam", TeamArgs.builder()        
                .pipelineId(pipeline.id())
                .teamId(team.id())
                .accessLevel("READ_ONLY")
                .build());
    
        }
    }
    
    resources:
      pipeline:
        type: buildkite:Pipeline:Pipeline
        properties:
          repository: https://github.com/...
      team:
        type: buildkite:Team:Team
        properties:
          privacy: VISIBLE
          defaultTeam: false
          defaultMemberRole: MEMBER
      # allow everyone in the "Everyone" team read-only access to pipeline
      pipelineTeam:
        type: buildkite:Pipeline:Team
        properties:
          pipelineId: ${pipeline.id}
          teamId: ${team.id}
          accessLevel: READ_ONLY
    

    Create Team Resource

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

    Constructor syntax

    new Team(name: string, args: TeamArgs, opts?: CustomResourceOptions);
    @overload
    def Team(resource_name: str,
             args: TeamArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Team(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             access_level: Optional[str] = None,
             pipeline_id: Optional[str] = None,
             team_id: Optional[str] = None)
    func NewTeam(ctx *Context, name string, args TeamArgs, opts ...ResourceOption) (*Team, error)
    public Team(string name, TeamArgs args, CustomResourceOptions? opts = null)
    public Team(String name, TeamArgs args)
    public Team(String name, TeamArgs args, CustomResourceOptions options)
    
    type: buildkite:Pipeline:Team
    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 TeamArgs
    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 TeamArgs
    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 TeamArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeamArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeamArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var teamResource = new Buildkite.Pipeline.Team("teamResource", new()
    {
        AccessLevel = "string",
        PipelineId = "string",
        TeamId = "string",
    });
    
    example, err := Pipeline.NewTeam(ctx, "teamResource", &Pipeline.TeamArgs{
    	AccessLevel: pulumi.String("string"),
    	PipelineId:  pulumi.String("string"),
    	TeamId:      pulumi.String("string"),
    })
    
    var teamResource = new Team("teamResource", TeamArgs.builder()        
        .accessLevel("string")
        .pipelineId("string")
        .teamId("string")
        .build());
    
    team_resource = buildkite.pipeline.Team("teamResource",
        access_level="string",
        pipeline_id="string",
        team_id="string")
    
    const teamResource = new buildkite.pipeline.Team("teamResource", {
        accessLevel: "string",
        pipelineId: "string",
        teamId: "string",
    });
    
    type: buildkite:Pipeline:Team
    properties:
        accessLevel: string
        pipelineId: string
        teamId: string
    

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

    AccessLevel string
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    PipelineId string
    The GraphQL ID of the pipeline.
    TeamId string
    The GraphQL ID of the team.
    AccessLevel string
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    PipelineId string
    The GraphQL ID of the pipeline.
    TeamId string
    The GraphQL ID of the team.
    accessLevel String
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipelineId String
    The GraphQL ID of the pipeline.
    teamId String
    The GraphQL ID of the team.
    accessLevel string
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipelineId string
    The GraphQL ID of the pipeline.
    teamId string
    The GraphQL ID of the team.
    access_level str
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipeline_id str
    The GraphQL ID of the pipeline.
    team_id str
    The GraphQL ID of the team.
    accessLevel String
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipelineId String
    The GraphQL ID of the pipeline.
    teamId String
    The GraphQL ID of the team.

    Outputs

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

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

    Look up Existing Team Resource

    Get an existing Team 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?: TeamState, opts?: CustomResourceOptions): Team
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_level: Optional[str] = None,
            pipeline_id: Optional[str] = None,
            team_id: Optional[str] = None,
            uuid: Optional[str] = None) -> Team
    func GetTeam(ctx *Context, name string, id IDInput, state *TeamState, opts ...ResourceOption) (*Team, error)
    public static Team Get(string name, Input<string> id, TeamState? state, CustomResourceOptions? opts = null)
    public static Team get(String name, Output<String> id, TeamState 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:
    AccessLevel string
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    PipelineId string
    The GraphQL ID of the pipeline.
    TeamId string
    The GraphQL ID of the team.
    Uuid string
    The UUID of the pipeline-team relationship.
    AccessLevel string
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    PipelineId string
    The GraphQL ID of the pipeline.
    TeamId string
    The GraphQL ID of the team.
    Uuid string
    The UUID of the pipeline-team relationship.
    accessLevel String
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipelineId String
    The GraphQL ID of the pipeline.
    teamId String
    The GraphQL ID of the team.
    uuid String
    The UUID of the pipeline-team relationship.
    accessLevel string
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipelineId string
    The GraphQL ID of the pipeline.
    teamId string
    The GraphQL ID of the team.
    uuid string
    The UUID of the pipeline-team relationship.
    access_level str
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipeline_id str
    The GraphQL ID of the pipeline.
    team_id str
    The GraphQL ID of the team.
    uuid str
    The UUID of the pipeline-team relationship.
    accessLevel String
    The access level for the team. Either READ_ONLY, BUILD_AND_READ or MANAGE_BUILD_AND_READ.
    pipelineId String
    The GraphQL ID of the pipeline.
    teamId String
    The GraphQL ID of the team.
    uuid String
    The UUID of the pipeline-team relationship.

    Import

    import a pipeline team resource using the GraphQL ID

    you can use this query to find the ID:

    query getPipelineTeamId {

    pipeline(slug: “ORGANIZATION_SLUG/PIPELINE_SLUG”) {

    teams(first: 5, search: "PIPELINE_SEARCH_TERM") {
    
      edges{
    
        node{
    
          id
    
        }
    
      }
    
    }
    

    }

    }

    $ pulumi import buildkite:Pipeline/team:Team guests VGVhbS0tLWU1YjQyMDQyLTUzN2QtNDZjNi04MjY0LTliZjFkMzkyYjZkNQ==
    

    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