codepipeline
Create or delete AWS CodePipelines
Collection: community.aws
Full Name: community.aws.codepipeline
Synopsis
Create or delete AWS CodePipelines
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| artifact_store | dict | yes | ||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| debug_botocore_endpoint_logs | bool | false | ||
| endpoint_url | str | |||
| name | str | yes | ||
| profile | str | |||
| region | str | |||
| role_arn | str | yes | ||
| secret_key | str | |||
| session_token | str | |||
| stages | list | yes | ||
| state | str | present | ||
| validate_certs | bool | true | ||
| version | int |
Example
yaml
# Example for creating a pipeline for continuous deploy of Github code to an ECS cluster (container)
- name: Create or delete AWS CodePipelines
community.aws.codepipeline:
name: my_deploy_pipeline
role_arn: arn:aws:iam::123456:role/AWS-CodePipeline-Service
artifact_store:
type: S3
location: my_s3_codepipline_bucket
stages:
- name: Get_source
actions:
- name: Git_pull
actionTypeId:
category: Source
owner: ThirdParty
provider: GitHub
version: '1'
outputArtifacts:
- {name: my-app-source}
configuration:
Owner: mediapeers
Repo: my_gh_repo
PollForSourceChanges: 'true'
Branch: master
# Generate token like this:
# https://docs.aws.amazon.com/codepipeline/latest/userguide/GitHub-rotate-personal-token-CLI.html
# GH Link: https://github.com/settings/tokens
OAuthToken: 'abc123def456'
runOrder: 1
- name: Build
actions:
- name: CodeBuild
actionTypeId:
category: Build
owner: AWS
provider: CodeBuild
version: '1'
inputArtifacts:
- {name: my-app-source}
outputArtifacts:
- {name: my-app-build}
configuration:
# A project with that name needs to be setup on AWS CodeBuild already (use code_build module).
ProjectName: codebuild-project-name
runOrder: 1
- name: ECS_deploy
actions:
- name: ECS_deploy
actionTypeId:
category: Deploy
owner: AWS
provider: ECS
version: '1'
inputArtifacts:
- {name: vod-api-app-build}
configuration:
# an ECS cluster with that name needs to be setup on AWS ECS already (use ecs_cluster and ecs_service module)
ClusterName: ecs-cluster-name
ServiceName: ecs-cluster-service-name
FileName: imagedefinitions.json
region: us-east-1
state: present