Connection class

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.codestarconnections.Connection("example", {
    name: "example-connection",
    providerType: "Bitbucket",
});
const examplePipeline = new aws.codepipeline.Pipeline("example", {
    artifactStores: [{}],
    stages: [
        {
            actions: [{
                name: "Source",
                category: "Source",
                owner: "AWS",
                provider: "CodeStarSourceConnection",
                version: "1",
                outputArtifacts: ["source_output"],
                configuration: {
                    ConnectionArn: example.arn,
                    FullRepositoryId: "my-organization/test",
                    BranchName: "main",
                },
            }],
            name: "Source",
        },
        {
            actions: [{}],
            name: "Build",
        },
        {
            actions: [{}],
            name: "Deploy",
        },
    ],
    name: "tf-test-pipeline",
    roleArn: codepipelineRole.arn,
});
import pulumi
import pulumi_aws as aws

example = aws.codestarconnections.Connection("example",
    name="example-connection",
    provider_type="Bitbucket")
example_pipeline = aws.codepipeline.Pipeline("example",
    artifact_stores=[{}],
    stages=[
        {
            "actions": [{
                "name": "Source",
                "category": "Source",
                "owner": "AWS",
                "provider": "CodeStarSourceConnection",
                "version": "1",
                "output_artifacts": ["source_output"],
                "configuration": {
                    "ConnectionArn": example.arn,
                    "FullRepositoryId": "my-organization/test",
                    "BranchName": "main",
                },
            }],
            "name": "Source",
        },
        {
            "actions": [{}],
            "name": "Build",
        },
        {
            "actions": [{}],
            "name": "Deploy",
        },
    ],
    name="tf-test-pipeline",
    role_arn=codepipeline_role["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

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

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

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := codestarconnections.NewConnection(ctx, "example", &codestarconnections.ConnectionArgs{
			Name:         pulumi.String("example-connection"),
			ProviderType: pulumi.String("Bitbucket"),
		})
		if err != nil {
			return err
		}
		_, err = codepipeline.NewPipeline(ctx, "example", &codepipeline.PipelineArgs{
			ArtifactStores: codepipeline.PipelineArtifactStoreArray{
				&codepipeline.PipelineArtifactStoreArgs{},
			},
			Stages: codepipeline.PipelineStageArray{
				&codepipeline.PipelineStageArgs{
					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":    example.Arn,
								"FullRepositoryId": pulumi.String("my-organization/test"),
								"BranchName":       pulumi.String("main"),
							},
						},
					},
					Name: pulumi.String("Source"),
				},
				&codepipeline.PipelineStageArgs{
					Actions: codepipeline.PipelineStageActionArray{
						&codepipeline.PipelineStageActionArgs{},
					},
					Name: pulumi.String("Build"),
				},
				&codepipeline.PipelineStageArgs{
					Actions: codepipeline.PipelineStageActionArray{
						&codepipeline.PipelineStageActionArgs{},
					},
					Name: pulumi.String("Deploy"),
				},
			},
			Name:    pulumi.String("tf-test-pipeline"),
			RoleArn: pulumi.Any(codepipelineRole.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_codestarconnections_connection" "example" {
  name          = "example-connection"
  provider_type = "Bitbucket"
}
resource "aws_codepipeline_pipeline" "example" {
  artifact_stores {
  }
  stages {
    actions {
      name             = "Source"
      category         = "Source"
      owner            = "AWS"
      provider         = "CodeStarSourceConnection"
      version          = "1"
      output_artifacts = ["source_output"]
      configuration = {
        "ConnectionArn"    = aws_codestarconnections_connection.example.arn
        "FullRepositoryId" = "my-organization/test"
        "BranchName"       = "main"
      }
    }
    name = "Source"
  }
  stages {
    actions {
    }
    name = "Build"
  }
  stages {
    actions {
    }
    name = "Deploy"
  }
  name     = "tf-test-pipeline"
  role_arn = codepipelineRole.arn
}
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 com.pulumi.aws.codepipeline.inputs.PipelineStageActionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Connection("example", ConnectionArgs.builder()
            .name("example-connection")
            .providerType("Bitbucket")
            .build());

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

    }
}
resources:
  example:
    type: aws:codestarconnections:Connection
    properties:
      name: example-connection
      providerType: Bitbucket
  examplePipeline:
    type: aws:codepipeline:Pipeline
    name: example
    properties:
      artifactStores:
        - {}
      stages:
        - actions:
            - name: Source
              category: Source
              owner: AWS
              provider: CodeStarSourceConnection
              version: '1'
              outputArtifacts:
                - source_output
              configuration:
                ConnectionArn: ${example.arn}
                FullRepositoryId: my-organization/test
                BranchName: main
          name: Source
        - actions:
            - {}
          name: Build
        - actions:
            - {}
          name: Deploy
      name: tf-test-pipeline
      roleArn: ${codepipelineRole.arn}

Import

Identity Schema

Required

  • arn (String) ARN of the CodeStar connection.

Using pulumi import, import CodeStar connections using the ARN. For example:

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

Constructors

Connection(String name, {ConnectionArgs? args, CustomResourceOptions? options})
Creates a new Connection. name The Pulumi resource name. args Arguments used to configure this Connection. The set of arguments for Connection. options Resource options controlling this resource's behavior.
Connection.reference(String urn)
Creates a typed reference to an existing Connection resource.

Properties

arn ↔ Output<String>
The codestar connection ARN.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
connectionStatus ↔ Output<String>
The codestar connection status. Possible values are PENDING, AVAILABLE and ERROR.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
hostArn ↔ Output<String?>
ARN of the host associated with the connection. Conflicts with providerType
latefinal
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<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.
latefinal
providerType ↔ Output<String>
The name of the external provider where your third-party code repository is configured. Valid values are Bitbucket, GitHub, GitHubEnterpriseServer, GitLab or GitLabSelfManaged. Changing providerType will create a new resource. Conflicts with hostArn
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Map of key-value resource tags to associate with the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ConnectionState? state, CustomResourceOptions? options}) → Connection
Gets an existing Connection resource's state with the given name and id.