This reference architecture demonstrates how to push code hosted in AWS CodeCommit repository in Development Account, use AWS CodeBuild to do application build, store the output artifacts in S3Bucket and deploy these artifacts to Test and Production Accounts using AWS CloudFormation. This orchestration of code movement from code checkin to deployment is securely handled by AWS CodePipeline.
Clone the AWS LAMBDA sample application GitHub repository.
From your terminal application, execute the following command:
git clone https://github.com/awslabs/aws-pipeline-to-service-catalog.git
This creates a directory named aws-pipeline-to-service-catalog
in your current directory, which contains the code for the AWS Lambda function sample application.
2. Create AWS CodeCommit repository in Development Account
Follow the instructions here to create a CodeCommit repository in the Development Account.Name your repository as sample-lambda
Alternatively, from your terminal application, execute the following command. You may refer here on further details, in order to setup AWS Cli , if required.
aws codecommit create-repository --repository-name sample-lambda --repository-description "Sample Lambda Function"
Note the cloneUrlHttp URL in the response from above CLI.
From your terminal application, execute the following command:
git remote add AWSCodeCommit HTTP_CLONE_URL_FROM_STEP_2
Follow the instructions here for local git setup required to push code to CodeCommit repository.
From your terminal application, execute the following command:
git push AWSCodeCommit master