The following tools need to be accessible in your development environment (laptop, container or cloud9 etc).
NOTE: The labs in this repository are baselined against a particular version of the CDK. While the CDK is in developer preview and can introduce breaking changes its important to install the correct version of the CDK.
- Java 8. Why not try Amazon Corretto..
- Maven. How to install Maven.
- Node + NPM (Required for CDK CLI Installation). How to install Node + NPM.
- CDK CLI. Make sure you install the correct version with
npm -i -g [email protected]
- Git. Install git.
- AWS CLI (Only required for configuring access keys). Install AWS CLI.
Verify you have the required tools by typing the following at a command line:
java --version
(should be 1.8+)
and
cdk --version
(should be 0.29.0)
You will need a github account if you don't have one already.
-
Make a personal fork of this project in your github account. For the devops pipelines we will be creating you will need the ability to add a commit hook to the target repository. This step will fail if you are using the master repository.
-
Clone a local copy of your forked repository to your development environment. i.e
git clone <clone url from github project>
-
Create a personal github token and ensure it has permissions to create commit hooks. The specific perimssions you need to ensure your token has are documented here. Please make a note of the personal token and store it somewhere you can retrieve later on down below.
You will need access to an AWS account and a set of IAM access keys to drive programmatic access to the AWS environment from the command line. Specifically you need the access keys to allow the CDK CLI to provision resources.
We also suggest that you pick an AWS region and stick with the same one for the duration of the labs. If you do change Regions you will need to repeat this environment bootstrapping process.
-
Log into the AWS Console and switch over to your target region using the region selector in the top right hand corner.
-
Open up the Secrets Manager Service and create a new secret for the github personal access token you created in the previous section. Choose to create a new secret for 'Other type of secret (API Key)' and put in an arbitrary key name and the github token as the value. Make a note of the secret name and the key. i.e for myself I have a secret called 'jousby/github' and the key is 'oauthToken'. This token is retrieved by your pipeline to enable access to your github project.
-
Open the S3 Service and create an s3 bucket in this region to be used by AWS CodeBuild for cacheing project dependencies during the maven build. i.e something along the lines of
<accountnumber>-<region>-codebuild-cache
. Make a note of the bucket name. -
If you don't have a set of access keys for accessing this aws environment from the command line then open up th IAM service and following these instructions to create your access keys.
-
Configure your command line to use the access keys created in the previous step by running
aws configure
. Make sure the environment you enter during the configuration wizard is the same as the one you were using in the console. -
If you have completed the aws configuration step successfully then when you run the cdk cli it should pick up your chosen region and access keys. Run
cdk bootstrap
to setup the cdk cli for deploying stacks in your chosen region. This boostrap process creates a cloudformation stack and some s3 buckets.