Go back to the AWS Cloud9 console. Click on MSKClient-Cloud9EC2Bastion.
Click on Open IDE (or go back to the browser tab if already open).
You should be connected to the KafkaClientEC2Instance instance. If not, ssh to the KafkaClientEC2Instance instance by pasting the ssh command you copied in the last section.
cd /tmp/kafka git clone https://github.com/aws-samples/integration-sample-lambda-msk.git cd integration-sample-lambda-msk
Run the deploy.sh script. The script does the following. (You can cat the script to look at its contents.)
Note: Change the values of MSK_STACK and KAFKA_CLIENT_STACK if you changed them from the default values.
export MSK_STACK=MSK export KAFKA_CLIENT_STACK=MSKClient export VPC_STACK=$(aws cloudformation describe-stacks --stack-name $MSK_STACK --query 'Stacks.Outputs[?OutputKey==`VPCStackName`].OutputValue' --output text) ./deploy.sh $VPC_STACK $KAFKA_CLIENT_STACK $MSK_STACK
At this point, everything is setup and the Lambda function is already processing records from Amazon MSK. We will look at the environment in the next section.