Try AWS Native preview for resources not in the classic version.
aws.codestarconnections.Connection
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides a CodeStar Connection.
NOTE: The
aws.codestarconnections.Connection
resource is created in the statePENDING
. 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: [
{
name: "Source",
actions: [{
name: "Source",
category: "Source",
owner: "AWS",
provider: "CodeStarSourceConnection",
version: "1",
outputArtifacts: ["source_output"],
configuration: {
ConnectionArn: example.arn,
FullRepositoryId: "my-organization/test",
BranchName: "main",
},
}],
},
{
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=[
{
"name": "Source",
"actions": [{
"name": "Source",
"category": "Source",
"owner": "AWS",
"provider": "CodeStarSourceConnection",
"version": "1",
"outputArtifacts": ["source_output"],
"configuration": {
"ConnectionArn": example.arn,
"FullRepositoryId": "my-organization/test",
"BranchName": "main",
},
}],
},
{
"actions": [{}],
"name": "Build",
},
{
"actions": [{}],
"name": "Deploy",
},
],
name="tf-test-pipeline",
role_arn=codepipeline_role["arn"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codepipeline"
"github.com/pulumi/pulumi-aws/sdk/v6/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{
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": example.Arn,
"FullRepositoryId": pulumi.String("my-organization/test"),
"BranchName": pulumi.String("main"),
},
},
},
},
&codepipeline.PipelineStageArgs{
Actions: codepipeline.PipelineStageActionArray{
nil,
},
Name: pulumi.String("Build"),
},
&codepipeline.PipelineStageArgs{
Actions: codepipeline.PipelineStageActionArray{
nil,
},
Name: pulumi.String("Deploy"),
},
},
Name: pulumi.String("tf-test-pipeline"),
RoleArn: pulumi.Any(codepipelineRole.Arn),
})
if err != nil {
return err
}
return nil
})
}
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
{
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", example.Arn },
{ "FullRepositoryId", "my-organization/test" },
{ "BranchName", "main" },
},
},
},
},
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 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 example = new Connection("example", ConnectionArgs.builder()
.name("example-connection")
.providerType("Bitbucket")
.build());
var examplePipeline = new Pipeline("examplePipeline", PipelineArgs.builder()
.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", example.arn()),
Map.entry("FullRepositoryId", "my-organization/test"),
Map.entry("BranchName", "main")
))
.build())
.build(),
PipelineStageArgs.builder()
.actions()
.name("Build")
.build(),
PipelineStageArgs.builder()
.actions()
.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:
- name: Source
actions:
- name: Source
category: Source
owner: AWS
provider: CodeStarSourceConnection
version: '1'
outputArtifacts:
- source_output
configuration:
ConnectionArn: ${example.arn}
FullRepositoryId: my-organization/test
BranchName: main
- actions:
- {}
name: Build
- actions:
- {}
name: Deploy
name: tf-test-pipeline
roleArn: ${codepipelineRole.arn}
Create Connection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Connection(name: string, args?: ConnectionArgs, opts?: CustomResourceOptions);
@overload
def Connection(resource_name: str,
args: Optional[ConnectionArgs] = None,
opts: Optional[ResourceOptions] = None)
@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)
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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsConnectionResource = new Aws.CodeStarConnections.Connection("awsConnectionResource", new()
{
HostArn = "string",
Name = "string",
ProviderType = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := codestarconnections.NewConnection(ctx, "awsConnectionResource", &codestarconnections.ConnectionArgs{
HostArn: pulumi.String("string"),
Name: pulumi.String("string"),
ProviderType: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var awsConnectionResource = new Connection("awsConnectionResource", ConnectionArgs.builder()
.hostArn("string")
.name("string")
.providerType("string")
.tags(Map.of("string", "string"))
.build());
aws_connection_resource = aws.codestarconnections.Connection("awsConnectionResource",
host_arn="string",
name="string",
provider_type="string",
tags={
"string": "string",
})
const awsConnectionResource = new aws.codestarconnections.Connection("awsConnectionResource", {
hostArn: "string",
name: "string",
providerType: "string",
tags: {
string: "string",
},
});
type: aws:codestarconnections:Connection
properties:
hostArn: string
name: string
providerType: string
tags:
string: string
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:
- Host
Arn 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. - Provider
Type string - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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.
- Host
Arn 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. - Provider
Type string - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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.
- host
Arn 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. - provider
Type String - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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.
- host
Arn 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. - provider
Type string - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- {[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
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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.
- host
Arn 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. - provider
Type String - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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.
- Connection
Status string - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - Id string
- The provider-assigned unique ID for this managed resource.
- 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.
- Connection
Status string - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - Id string
- The provider-assigned unique ID for this managed resource.
- 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.
- connection
Status String - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - id String
- The provider-assigned unique ID for this managed resource.
- 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.
- connection
Status string - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - id string
- The provider-assigned unique ID for this managed resource.
- {[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
andERROR
. - id str
- The provider-assigned unique ID for this managed resource.
- 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.
- connection
Status String - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - id String
- The provider-assigned unique ID for this managed resource.
- 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.
- Arn string
- The codestar connection ARN.
- Connection
Status string - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - Host
Arn 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. - Provider
Type string - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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. - 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.
- Connection
Status string - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - Host
Arn 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. - Provider
Type string - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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. - 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.
- connection
Status String - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - host
Arn 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. - provider
Type String - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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. - 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.
- connection
Status string - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - host
Arn 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. - provider
Type string - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- {[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. - {[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
andERROR
. - 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
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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. - 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.
- connection
Status String - The codestar connection status. Possible values are
PENDING
,AVAILABLE
andERROR
. - host
Arn 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. - provider
Type String - The name of the external provider where your third-party code repository is configured. Valid values are
Bitbucket
,GitHub
,GitHubEnterpriseServer
,GitLab
orGitLabSelfManaged
. Changingprovider_type
will create a new resource. Conflicts withhost_arn
- 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.