Create a Microservices App
Create the microservices environment (GUI)¶
- Download this CloudFormation template. This template contains all the objects (and code) that are needed for the microservices app that you will instrument.
- Navigate to CloudFormation in the AWS console. Make sure you are in the 'us-east-1' (N. Virginia) region!!! The CloudFormation template is written for that region ONLY.
- At the top-right, click
Create stack
>With new resources (standard)
. - On the 'Create stack' page, select
Upload a template file
, and thenChoose file
to select the CloudFormation template you downloaded in Step 1. ClickNext
. - To complete the CloudFormation stack creation, give the stack a name (e.g.
lambda-stack
), and under 'Parameters', enter a name for the S3 bucket to be used by the microservices app. ClickNext
. Note that this name must be unique across all of AWS. - On the next page titled 'Configure stack options', scroll all the way down and click
Next
. Finally, on the 'Review' page, scroll to the bottom, and select the checkbox that says 'I acknowledge that AWS CloudFormation might create IAM resources with custom names.' Then clickCreate stack
. - You should now see that your stack has a status of 'CREATE_IN_PROGRESS'. Wait until it says 'CREATE_COMPLETE' (or spam the refresh button, your choice). You now have a microservices app running on AWS Lambda!
Create the microservices environment (CLI)¶
- This CLI Command can be executed by either pointing the
--template-body
parameter to the local path of the Cloudformation template file, or passing--template-url <An URL to an S3-based location of a template file>
- Execute the following AWS CLI Command:
As an example:
aws cloudformation create-stack \ --stack-name <some-arbitrary-name> \ --template-body file://<local-path-to-'AlpacaTraderWorkshopIncomplete.template'> \ --region us-east-1 \ --parameters ParameterKey=bucketName,ParameterValue=<some-arbitrary-s3-bucket-name> \ --capabilities CAPABILITY_NAMED_IAM \ --role-arn <the-cfn-serivce-account-role-arn>
aws cloudformation create-stack \ --stack-name lambda-demo-tsj-splunk-100 \ --template-body file:///Users/tjohander/splunk/projects/lambda-apm-workshop/AlpacaTraderWorkshopIncomplete.template \ --region us-east-1 \ --parameters ParameterKey=bucketName,ParameterValue=tsj-splunk-alpaca-bucket-100 \ --capabilities CAPABILITY_NAMED_IAM \ --role-arn arn:aws:iam::12345678:role/cloudformation-service-role
Last update:
August 3, 2022