Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharinas/aws-codepipeline-demo
An example of an AWS CodePipeline that demonstrates fundamental concepts of building and using a pipeline with AWS CodePipeline and AWS CodeBuild.
https://github.com/sharinas/aws-codepipeline-demo
aws aws-cloudformation ci-cd cicd cloudformation codepipeline pipeline
Last synced: about 1 month ago
JSON representation
An example of an AWS CodePipeline that demonstrates fundamental concepts of building and using a pipeline with AWS CodePipeline and AWS CodeBuild.
- Host: GitHub
- URL: https://github.com/sharinas/aws-codepipeline-demo
- Owner: SharinaS
- Created: 2021-05-20T23:30:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-24T18:34:50.000Z (about 3 years ago)
- Last Synced: 2023-03-03T01:06:18.958Z (almost 2 years ago)
- Topics: aws, aws-cloudformation, ci-cd, cicd, cloudformation, codepipeline, pipeline
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS CodePipeline Demo
The `pipeline.yaml` CloudFormation template deploys a pipeline that:
* Reads the contents of the directory in the GitHub repository
* Uses the cfn-nag tool as a linter
* Deploys a CloudFormation template. This template is the `cfn-template.yaml` file, which upon deployment creates a simple S3 bucket. The template is deployed into the same account as the CodePipeline is in, however with appropriate IAM permissions, cross-account deployment can be configured. The `DeploymentRole` is deployed from a separate file, `deployment-role.yaml`, to allow for this possibility.
* Runs tests. Currently the pipeline saves the outputs of the CloudFormation deployment into a file and reads it.
* Passes artifacts, such as the artifact that is passed to the final testing stage in the pipeline.## Deploy with the AWS CLI
### Prerequisites
To deploy the CodePipeline template, you will need:
* the AWS CLI installed and configured (how to do this is [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in AWS documentation)
* to deploy the `deployment-role.yaml` file, which provides the permissions necessary for the pipeline to deploy a CloudFormation stack
* A CodeStart connection established in the account you want to create a CodePipeline in. More info available on AWS, [here](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html).
* a separate JSON file stored within a `parameters` directory and updated to provide the following parameters:```json
[
"ProductName=your-product-name",
"Environment=your-environment-such-as-dev",
"GitHubBranchName=your-github-branch-name",
"TargetAccountForCFnDeployment=current-account-number-to-deploy-the-s3-bucket-yaml-file-into",
"GitHubOwner=your-GitHub-name",
"GitHubRepoName=your-GitHub-repo-name",
"GitHubConnectionArn=arn:aws:codestar-connections:::connection/"
]
```### Deploy the Deployment-Role First
This role gives the pipeline permission to deploy a CloudFormation template into an AWS account.
Deploy from the AWS CLI:
```bash
aws cloudformation deploy \
--template-file "deployment-role.yaml" \
--stack-name \
--parameter-overrides file://role-parameters/.json \
--profile
--capabilities CAPABILITY_NAMED_IAM
```### Deploy the Pipeline Once the Above Role has been Deployed
Deploy from the AWS CLI:
```bash
aws cloudformation deploy \
--template-file "pipeline.yaml" \
--stack-name \
--parameter-overrides file://parameters/.json \
--profile \
--capabilities CAPABILITY_NAMED_IAM
```