Module codepipeline
This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the
pulumi/pulumi-awsrepo; however, if that doesn’t turn up anything, please consult the sourceterraform-providers/terraform-provider-awsrepo.
Resources
Others
Resources
Resource Pipeline
class Pipeline extends CustomResourceProvides a CodePipeline.
NOTE on
aws.codepipeline.Pipeline: - theGITHUB_TOKENenvironment variable must be set if the GitHub provider is specified.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const codepipelineBucket = new aws.s3.Bucket("codepipeline_bucket", {
acl: "private",
});
const codepipelineRole = new aws.iam.Role("codepipeline_role", {
assumeRolePolicy: `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "codepipeline.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
`,
});
const codepipelinePolicy = new aws.iam.RolePolicy("codepipeline_policy", {
policy: pulumi.interpolate`{
"Version": "2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion",
"s3:GetBucketVersioning",
"s3:PutObject"
],
"Resource": [
"${codepipelineBucket.arn}",
"${codepipelineBucket.arn}/*"
]
},
{
"Effect": "Allow",
"Action": [
"codebuild:BatchGetBuilds",
"codebuild:StartBuild"
],
"Resource": "*"
}
]
}
`,
role: codepipelineRole.id,
});
const s3kmskey = pulumi.output(aws.kms.getAlias({
name: "alias/myKmsKey",
}, { async: true }));
const codepipeline = new aws.codepipeline.Pipeline("codepipeline", {
artifactStores: {
encryptionKey: {
id: s3kmskey.arn,
type: "KMS",
},
location: codepipelineBucket.bucket,
type: "S3",
},
roleArn: codepipelineRole.arn,
stages: [
{
actions: [{
category: "Source",
configuration: {
Branch: "master",
Owner: "my-organization",
Repo: "test",
},
name: "Source",
outputArtifacts: ["source_output"],
owner: "ThirdParty",
provider: "GitHub",
version: "1",
}],
name: "Source",
},
{
actions: [{
category: "Build",
configuration: {
ProjectName: "test",
},
inputArtifacts: ["source_output"],
name: "Build",
outputArtifacts: ["build_output"],
owner: "AWS",
provider: "CodeBuild",
version: "1",
}],
name: "Build",
},
{
actions: [{
category: "Deploy",
configuration: {
ActionMode: "REPLACE_ON_FAILURE",
Capabilities: "CAPABILITY_AUTO_EXPAND,CAPABILITY_IAM",
OutputFileName: "CreateStackOutput.json",
StackName: "MyStack",
TemplatePath: "build_output::sam-templated.yaml",
},
inputArtifacts: ["build_output"],
name: "Deploy",
owner: "AWS",
provider: "CloudFormation",
version: "1",
}],
name: "Deploy",
},
],
});constructor
new Pipeline(name: string, args: PipelineArgs, opts?: pulumi.CustomResourceOptions)Create a Pipeline resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PipelineState, opts?: pulumi.CustomResourceOptions): PipelineGet an existing Pipeline resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is PipelineReturns true if the given object is an instance of Pipeline. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property arn
public arn: pulumi.Output<string>;The codepipeline ARN.
property artifactStore
public artifactStore: pulumi.Output<PipelineArtifactStore>;One or more artifactStore blocks. Artifact stores are documented below.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property name
public name: pulumi.Output<string>;The name of the pipeline.
property roleArn
public roleArn: pulumi.Output<string>;A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
property stages
public stages: pulumi.Output<PipelineStage[]>;A stage block. Stages are documented below.
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A map of tags to assign to the resource.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource Webhook
class Webhook extends CustomResourceProvides a CodePipeline Webhook.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as github from "@pulumi/github";
const barPipeline = new aws.codepipeline.Pipeline("bar", {
artifactStores: {
encryptionKey: {
id: aws_kms_alias_s3kmskey.arn,
type: "KMS",
},
location: aws_s3_bucket_bar.bucket,
type: "S3",
},
roleArn: aws_iam_role_bar.arn,
stages: [
{
actions: [{
category: "Source",
configuration: {
Branch: "master",
Owner: "my-organization",
Repo: "test",
},
name: "Source",
outputArtifacts: ["test"],
owner: "ThirdParty",
provider: "GitHub",
version: "1",
}],
name: "Source",
},
{
actions: [{
category: "Build",
configuration: {
ProjectName: "test",
},
inputArtifacts: ["test"],
name: "Build",
owner: "AWS",
provider: "CodeBuild",
version: "1",
}],
name: "Build",
},
],
});
const webhookSecret = "super-secret";
const barWebhook = new aws.codepipeline.Webhook("bar", {
authentication: "GITHUB_HMAC",
authenticationConfiguration: {
secretToken: webhookSecret,
},
filters: [{
jsonPath: "$.ref",
matchEquals: "refs/heads/{Branch}",
}],
targetAction: "Source",
targetPipeline: barPipeline.name,
});
// Wire the CodePipeline webhook into a GitHub repository.
const barRepositoryWebhook = new github.RepositoryWebhook("bar", {
configuration: {
contentType: "json",
insecureSsl: true,
secret: webhookSecret,
url: barWebhook.url,
},
events: ["push"],
repository: github_repository_repo.name,
});constructor
new Webhook(name: string, args: WebhookArgs, opts?: pulumi.CustomResourceOptions)Create a Webhook resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: WebhookState, opts?: pulumi.CustomResourceOptions): WebhookGet an existing Webhook resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is WebhookReturns true if the given object is an instance of Webhook. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property authentication
public authentication: pulumi.Output<string>;The type of authentication to use. One of IP, GITHUB_HMAC, or UNAUTHENTICATED.
property authenticationConfiguration
public authenticationConfiguration: pulumi.Output<WebhookAuthenticationConfiguration | undefined>;An auth block. Required for IP and GITHUB_HMAC. Auth blocks are documented below.
property filters
public filters: pulumi.Output<WebhookFilter[]>;One or more filter blocks. Filter blocks are documented below.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property name
public name: pulumi.Output<string>;The name of the webhook.
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A map of tags to assign to the resource.
property targetAction
public targetAction: pulumi.Output<string>;The name of the action in a pipeline you want to connect to the webhook. The action must be from the source (first) stage of the pipeline.
property targetPipeline
public targetPipeline: pulumi.Output<string>;The name of the pipeline.
property url
public url: pulumi.Output<string>;The CodePipeline webhook’s URL. POST events to this endpoint to trigger the target.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Others
interface PipelineArgs
interface PipelineArgsThe set of arguments for constructing a Pipeline resource.
property artifactStore
artifactStore: pulumi.Input<PipelineArtifactStore>;One or more artifactStore blocks. Artifact stores are documented below.
property name
name?: pulumi.Input<string>;The name of the pipeline.
property roleArn
roleArn: pulumi.Input<string>;A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
property stages
stages: pulumi.Input<pulumi.Input<PipelineStage>[]>;A stage block. Stages are documented below.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
interface PipelineState
interface PipelineStateInput properties used for looking up and filtering Pipeline resources.
property arn
arn?: pulumi.Input<string>;The codepipeline ARN.
property artifactStore
artifactStore?: pulumi.Input<PipelineArtifactStore>;One or more artifactStore blocks. Artifact stores are documented below.
property name
name?: pulumi.Input<string>;The name of the pipeline.
property roleArn
roleArn?: pulumi.Input<string>;A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
property stages
stages?: pulumi.Input<pulumi.Input<PipelineStage>[]>;A stage block. Stages are documented below.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
interface WebhookArgs
interface WebhookArgsThe set of arguments for constructing a Webhook resource.
property authentication
authentication: pulumi.Input<string>;The type of authentication to use. One of IP, GITHUB_HMAC, or UNAUTHENTICATED.
property authenticationConfiguration
authenticationConfiguration?: pulumi.Input<WebhookAuthenticationConfiguration>;An auth block. Required for IP and GITHUB_HMAC. Auth blocks are documented below.
property filters
filters: pulumi.Input<pulumi.Input<WebhookFilter>[]>;One or more filter blocks. Filter blocks are documented below.
property name
name?: pulumi.Input<string>;The name of the webhook.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
property targetAction
targetAction: pulumi.Input<string>;The name of the action in a pipeline you want to connect to the webhook. The action must be from the source (first) stage of the pipeline.
property targetPipeline
targetPipeline: pulumi.Input<string>;The name of the pipeline.
interface WebhookState
interface WebhookStateInput properties used for looking up and filtering Webhook resources.
property authentication
authentication?: pulumi.Input<string>;The type of authentication to use. One of IP, GITHUB_HMAC, or UNAUTHENTICATED.
property authenticationConfiguration
authenticationConfiguration?: pulumi.Input<WebhookAuthenticationConfiguration>;An auth block. Required for IP and GITHUB_HMAC. Auth blocks are documented below.
property filters
filters?: pulumi.Input<pulumi.Input<WebhookFilter>[]>;One or more filter blocks. Filter blocks are documented below.
property name
name?: pulumi.Input<string>;The name of the webhook.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
property targetAction
targetAction?: pulumi.Input<string>;The name of the action in a pipeline you want to connect to the webhook. The action must be from the source (first) stage of the pipeline.
property targetPipeline
targetPipeline?: pulumi.Input<string>;The name of the pipeline.
property url
url?: pulumi.Input<string>;The CodePipeline webhook’s URL. POST events to this endpoint to trigger the target.