aws logo
AWS Classic v5.41.0, May 15 23

aws.codestarconnections.Connection

Explore with Pulumi AI

Provides a CodeStar Connection.

NOTE: The aws.codestarconnections.Connection resource is created in the state PENDING. Authentication with the connection provider must be completed in the AWS Console. See the AWS documentation for details.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleConnection = new Aws.CodeStarConnections.Connection("exampleConnection", new()
    {
        ProviderType = "Bitbucket",
    });

    var examplePipeline = new Aws.CodePipeline.Pipeline("examplePipeline", new()
    {
        RoleArn = aws_iam_role.Codepipeline_role.Arn,
        ArtifactStores = new[]
        {
            null,
        },
        Stages = new[]
        {
            new Aws.CodePipeline.Inputs.PipelineStageArgs
            {
                Name = "Source",
                Actions = new[]
                {
                    new Aws.CodePipeline.Inputs.PipelineStageActionArgs
                    {
                        Name = "Source",
                        Category = "Source",
                        Owner = "AWS",
                        Provider = "CodeStarSourceConnection",
                        Version = "1",
                        OutputArtifacts = new[]
                        {
                            "source_output",
                        },
                        Configuration = 
                        {
                            { "ConnectionArn", exampleConnection.Arn },
                            { "FullRepositoryId", "my-organization/test" },
                            { "BranchName", "main" },
                        },
                    },
                },
            },
            new Aws.CodePipeline.Inputs.PipelineStageArgs
            {
                Name = "Build",
                Actions = new[]
                {
                    null,
                },
            },
            new Aws.CodePipeline.Inputs.PipelineStageArgs
            {
                Name = "Deploy",
                Actions = new[]
                {
                    null,
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/codepipeline"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/codestarconnections"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleConnection, err := codestarconnections.NewConnection(ctx, "exampleConnection", &codestarconnections.ConnectionArgs{
			ProviderType: pulumi.String("Bitbucket"),
		})
		if err != nil {
			return err
		}
		_, err = codepipeline.NewPipeline(ctx, "examplePipeline", &codepipeline.PipelineArgs{
			RoleArn: pulumi.Any(aws_iam_role.Codepipeline_role.Arn),
			ArtifactStores: codepipeline.PipelineArtifactStoreArray{
				nil,
			},
			Stages: codepipeline.PipelineStageArray{
				&codepipeline.PipelineStageArgs{
					Name: pulumi.String("Source"),
					Actions: codepipeline.PipelineStageActionArray{
						&codepipeline.PipelineStageActionArgs{
							Name:     pulumi.String("Source"),
							Category: pulumi.String("Source"),
							Owner:    pulumi.String("AWS"),
							Provider: pulumi.String("CodeStarSourceConnection"),
							Version:  pulumi.String("1"),
							OutputArtifacts: pulumi.StringArray{
								pulumi.String("source_output"),
							},
							Configuration: pulumi.StringMap{
								"ConnectionArn":    exampleConnection.Arn,
								"FullRepositoryId": pulumi.String("my-organization/test"),
								"BranchName":       pulumi.String("main"),
							},
						},
					},
				},
				&codepipeline.PipelineStageArgs{
					Name: pulumi.String("Build"),
					Actions: codepipeline.PipelineStageActionArray{
						nil,
					},
				},
				&codepipeline.PipelineStageArgs{
					Name: pulumi.String("Deploy"),
					Actions: codepipeline.PipelineStageActionArray{
						nil,
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codestarconnections.Connection;
import com.pulumi.aws.codestarconnections.ConnectionArgs;
import com.pulumi.aws.codepipeline.Pipeline;
import com.pulumi.aws.codepipeline.PipelineArgs;
import com.pulumi.aws.codepipeline.inputs.PipelineArtifactStoreArgs;
import com.pulumi.aws.codepipeline.inputs.PipelineStageArgs;
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 exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()        
            .providerType("Bitbucket")
            .build());

        var examplePipeline = new Pipeline("examplePipeline", PipelineArgs.builder()        
            .roleArn(aws_iam_role.codepipeline_role().arn())
            .artifactStores()
            .stages(            
                PipelineStageArgs.builder()
                    .name("Source")
                    .actions(PipelineStageActionArgs.builder()
                        .name("Source")
                        .category("Source")
                        .owner("AWS")
                        .provider("CodeStarSourceConnection")
                        .version("1")
                        .outputArtifacts("source_output")
                        .configuration(Map.ofEntries(
                            Map.entry("ConnectionArn", exampleConnection.arn()),
                            Map.entry("FullRepositoryId", "my-organization/test"),
                            Map.entry("BranchName", "main")
                        ))
                        .build())
                    .build(),
                PipelineStageArgs.builder()
                    .name("Build")
                    .actions()
                    .build(),
                PipelineStageArgs.builder()
                    .name("Deploy")
                    .actions()
                    .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_connection = aws.codestarconnections.Connection("exampleConnection", provider_type="Bitbucket")
example_pipeline = aws.codepipeline.Pipeline("examplePipeline",
    role_arn=aws_iam_role["codepipeline_role"]["arn"],
    artifact_stores=[aws.codepipeline.PipelineArtifactStoreArgs()],
    stages=[
        aws.codepipeline.PipelineStageArgs(
            name="Source",
            actions=[aws.codepipeline.PipelineStageActionArgs(
                name="Source",
                category="Source",
                owner="AWS",
                provider="CodeStarSourceConnection",
                version="1",
                output_artifacts=["source_output"],
                configuration={
                    "ConnectionArn": example_connection.arn,
                    "FullRepositoryId": "my-organization/test",
                    "BranchName": "main",
                },
            )],
        ),
        aws.codepipeline.PipelineStageArgs(
            name="Build",
            actions=[aws.codepipeline.PipelineStageActionArgs()],
        ),
        aws.codepipeline.PipelineStageArgs(
            name="Deploy",
            actions=[aws.codepipeline.PipelineStageActionArgs()],
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleConnection = new aws.codestarconnections.Connection("exampleConnection", {providerType: "Bitbucket"});
const examplePipeline = new aws.codepipeline.Pipeline("examplePipeline", {
    roleArn: aws_iam_role.codepipeline_role.arn,
    artifactStores: [{}],
    stages: [
        {
            name: "Source",
            actions: [{
                name: "Source",
                category: "Source",
                owner: "AWS",
                provider: "CodeStarSourceConnection",
                version: "1",
                outputArtifacts: ["source_output"],
                configuration: {
                    ConnectionArn: exampleConnection.arn,
                    FullRepositoryId: "my-organization/test",
                    BranchName: "main",
                },
            }],
        },
        {
            name: "Build",
            actions: [{}],
        },
        {
            name: "Deploy",
            actions: [{}],
        },
    ],
});
resources:
  exampleConnection:
    type: aws:codestarconnections:Connection
    properties:
      providerType: Bitbucket
  examplePipeline:
    type: aws:codepipeline:Pipeline
    properties:
      roleArn: ${aws_iam_role.codepipeline_role.arn}
      artifactStores:
        - {}
      stages:
        - name: Source
          actions:
            - name: Source
              category: Source
              owner: AWS
              provider: CodeStarSourceConnection
              version: '1'
              outputArtifacts:
                - source_output
              configuration:
                ConnectionArn: ${exampleConnection.arn}
                FullRepositoryId: my-organization/test
                BranchName: main
        - name: Build
          actions:
            - {}
        - name: Deploy
          actions:
            - {}

Create Connection Resource

new Connection(name: string, args?: ConnectionArgs, opts?: CustomResourceOptions);
@overload
def Connection(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               host_arn: Optional[str] = None,
               name: Optional[str] = None,
               provider_type: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
@overload
def Connection(resource_name: str,
               args: Optional[ConnectionArgs] = None,
               opts: Optional[ResourceOptions] = None)
func NewConnection(ctx *Context, name string, args *ConnectionArgs, opts ...ResourceOption) (*Connection, error)
public Connection(string name, ConnectionArgs? args = null, CustomResourceOptions? opts = null)
public Connection(String name, ConnectionArgs args)
public Connection(String name, ConnectionArgs args, CustomResourceOptions options)
type: aws:codestarconnections:Connection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ConnectionArgs
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 ConnectionArgs
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 ConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

HostArn string

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

Name string

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

ProviderType string

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

Tags Dictionary<string, string>

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

HostArn string

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

Name string

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

ProviderType string

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

Tags map[string]string

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

hostArn String

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name String

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

providerType String

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags Map<String,String>

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

hostArn string

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name string

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

providerType string

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags {[key: string]: string}

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

host_arn str

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name str

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

provider_type str

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags Mapping[str, str]

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

hostArn String

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name String

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

providerType String

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags Map<String>

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

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

Arn string

The codestar connection ARN.

ConnectionStatus string

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The codestar connection ARN.

ConnectionStatus string

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The codestar connection ARN.

connectionStatus String

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The codestar connection ARN.

connectionStatus string

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

id string

The provider-assigned unique ID for this managed resource.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The codestar connection ARN.

connection_status str

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

id str

The provider-assigned unique ID for this managed resource.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The codestar connection ARN.

connectionStatus String

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing Connection Resource

Get an existing Connection 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?: ConnectionState, opts?: CustomResourceOptions): Connection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        connection_status: Optional[str] = None,
        host_arn: Optional[str] = None,
        name: Optional[str] = None,
        provider_type: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Connection
func GetConnection(ctx *Context, name string, id IDInput, state *ConnectionState, opts ...ResourceOption) (*Connection, error)
public static Connection Get(string name, Input<string> id, ConnectionState? state, CustomResourceOptions? opts = null)
public static Connection get(String name, Output<String> id, ConnectionState 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:
Arn string

The codestar connection ARN.

ConnectionStatus string

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

HostArn string

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

Name string

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

ProviderType string

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

Tags Dictionary<string, string>

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The codestar connection ARN.

ConnectionStatus string

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

HostArn string

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

Name string

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

ProviderType string

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

Tags map[string]string

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The codestar connection ARN.

connectionStatus String

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

hostArn String

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name String

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

providerType String

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags Map<String,String>

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The codestar connection ARN.

connectionStatus string

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

hostArn string

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name string

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

providerType string

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags {[key: string]: string}

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The codestar connection ARN.

connection_status str

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

host_arn str

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name str

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

provider_type str

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags Mapping[str, str]

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The codestar connection ARN.

connectionStatus String

The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.

hostArn String

The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with provider_type

name String

The name of the connection to be created. The name must be unique in the calling AWS account. Changing name will create a new resource.

providerType String

The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub or GitHubEnterpriseServer. Changing provider_type will create a new resource. Conflicts with host_arn

tags Map<String>

Map of key-value resource tags to associate with the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Import

CodeStar connections can be imported using the ARN, e.g.,

 $ pulumi import aws:codestarconnections/connection:Connection test-connection arn:aws:codestar-connections:us-west-1:0123456789:connection/79d4d357-a2ee-41e4-b350-2fe39ae59448

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.