0.1.0 • Published 2 years ago
@gdsgroup/aws-pipeline v0.1.0
aws-pipeline
Provision AWS CodePipeline and CodeBuild Project
Requirements
Name | Version |
---|---|
Pulumi | >= 3.8.0, < 4.0.0 |
Providers
Name | Version |
---|---|
aws | >= 3.51.0, < 4.0.0 |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | The common name for resources created as part of this module | string | n/a | yes |
description | Description of the codebuild project | string | n/a | no |
buildTimeOut | Number in minutes between 5 to 480 (8 hours) until the build times out | number | n/a | no |
IAMRoleARN | The ARN of the IAM role the pipeline will assume | string | n/a | no |
buildStages | Define custom build stages for the pipeline. See pipeline reference | PipelineStage[] | See Example Below | no |
codebuildComputeType | The computeType of the build container | string | BUILD_GENERAL1_SMALL | no |
codebuildImage | The codebuild docker image | string | aws/codebuild/standard:5.0 | no |
codebuildEnvironmentVariables | Codebuild Environment variables | ProjectEnvironmentEnvironmentVariable[] | n/a | no |
githubRepo | The Github repo to pull the source from in the form of 'org/repo' or 'user/repo' | string | n/a | yes |
githubBranch | The branch to pull source from | string | main | no |
pipelineSourceConnectionArn | The ARN of the codestar connection. See: https://www.pulumi.com/registry/packages/aws/api-docs/codestarconnections/connection/ | string | n/a | yes |
Outputs
Name | Description |
---|---|
codepipelineBucket | The S3 bucket created by this module |
codepipeline | The codepipeline created by this module |
codebuildProject | The codebuild project created by this module |
Usage
Note
Ensure your buildspec.yml is in the root of the GitHub repository that you passed to the Input githubRepo
(See #Inputs above)
Ensure you have the following set in your environment
export PULUMI_PREFER_YARN=true
export PULUMI_CONFIG_PASSPHRASE=<PASSPHRASE HERE>
export PULUMI_BACKEND_URL=`s3://<PULUMI STATE BUCKET HERE>/<SUB PATH HERE>`
pulumi preview
pulumi up
Debug
pulumi up --logtostderr -v=9 2> out.txt
Examples
Simplest Usage
import { AwsPipeline } from 'gdsgroup/aws-pipeline'
import { codestarconnections } from '@pulumi/aws'
const connection = new codestarconnections.Connection('example', {
name: 'example',
providerType: 'GitHub',
});
const demo = new AwsPipeline('example', {
name: 'example',
githubRepo: 'org-name/repo-name',
pipelineSourceConnectionArn: connection.arn,
});
Define Your Own Pipeline Build Stage
import { AwsPipeline } from 'gdsgroup/aws-pipeline'
import { codestarconnections } from '@pulumi/aws'
const connection = new codestarconnections.Connection('example', {
name: 'example',
providerType: 'GitHub',
});
const test = new AwsPipeline('example', {
name: 'example',
githubRepo: 'org-name/repo-name',
pipelineSourceConnectionArn: connection.arn,
buildTimeOut: 90,
buildStages: [
{
name: 'Build',
actions: [
{
name: 'Build',
category: 'Build',
owner: 'AWS',
provider: 'CodeDeploy',
inputArtifacts: ['source-output-artifact'],
version: '1',
runOrder: 2,
configuration: {
PrimarySource: 'source-output-artifact',
ProjectName: codeDeployProjectName,
},
},
],
},
],
});
See Pipeline reference
PULUMI_BACKEND_URL=s3://dev-immersify-state-bucket/aws-pipeline
0.1.0
2 years ago