Cyberdojo

Posts | Projects | Cloudwatch-AI LIVE Demo | Contact

Installing CDF

Introduction

Cloud Deployment Framework (CDF) automatically builds secure deployment piplines using AWS CodePipeline and CodeBuild.

Cloud Deployment Framework (CDF)

Requirements

You will need the following on your local machine:

  1. Python3
  2. awscli
  3. cdk: run the Bootstrapping process four at https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html
cdk bootstrap aws://ACCOUNT-NUMBER/REGION-1
  1. docker

Configuration

  1. Clone the repo
git clone https://github.com/Ahmed-AG/cdf.git
  1. Rename config.d.templates to config.d
  2. Edit config.d/config.json to set pipelines names, sources, deployment options, and any parameters needed

Sample config.json file:

{
    "pipelines" :[
        {
            "name" : "Production-Pipeline1",
            "provider" : "aws",
            "source" : {
                "source_type" : "codecommit",
                "repo_name" : "cdf-repo1",
                "branch" : "main"
            },
            "deployment" : {
                "assume_role" :{
                    "role": "TODO"
                },
                "aws_account" : "",
                "iam_policy_file" : "config.d/iam-policy.json",
                "region" : "us-east-1",
                "type" : "cfn",
                "parameters" : "VpcCIDR=10.0.0.0/16 Region=$REGION",
                "capabilities" : "CAPABILITY_IAM CAPABILITY_NAMED_IAM",
                "deployment_file" : "main.yaml",
                "checks" : [
                    "general_all",
                    "cfn_nag", 
                    "checkov"
                ]
            }
        }
    ]
}
  1. Edit the IAM policy file used by the pipeline to deploy resources config.d/iam-policy.json Note: This file is referenced in config.d/config.json. It is recomended to have different policies for each pipeline

  2. Run:
    cdk deploy --all
    
  3. Verify that your pipelines were created in Codepipline in AWS console

By: Ahmed Abugharbia
Date: 07-20-2022