Lab complete!
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool
In this section, we will deploy our base lab infrastructure using AWS Serverless Application Model (AWS SAM) in AWS Cloud9 environment. This will consist of a public Amazon API Gateway which connects to AWS Lambda function that puts items in AWS DynamoDB. We will also create a rule in Amazon EventBridge and another AWS Lambda that will retrieve data related to cost optimization from AWS Compute Optimizer and AWS Trusted Advisor.
Our initial deployment should reflect the following diagram:
Note the following:
AWS SAM deployment includes an Amazon API gateway with an IAM role to invoke our Lambda function. This function references a JSON mapping file that contains trusted advisor check IDs allowing for mapping to the appropriate questions within the Well-Architected tool.
AWS Lambda function puts items in AWS DynamoDB.
In the Well-Architected Tool, a reviewer will define a workload which is a collection of resources and applications that delivers business value.
Defining a workload in the Well-Architected Tool generates an API event called CreateWorkload that Amazon EventBridge receives. This will invoke the second AWS Lambda function.
This AWS Lambda function collects usage data and recommends an appropriate instance type based on rightsizing information from AWS Compute Optimizer and AWS Trusted Advisor.
The AWS Lambda function will be able to retrieve Question ID from AWS DynamoDB.
The AWS Lambda function eventually updates data points into Notes in Well-Architected Tool.
Note: Select the region in which your EC2 Instances are running.
To deploy the template for the base infrastructure, complete the following steps:
You can get the CloudFormation template here.
The first CloudFormation template will deploy AWS Cloud9 and you can create CloudFormation Stack directly via the AWS console.
cd /home/ec2-user/environment/aws-well-architected-labs/static/watool/200_Integration_with_AWS_Compute_Optimizer_and_AWS_Trusted_Advisor/Code/integration
sam build
sam deploy --guided
curl --header "Content-Type: application/json" -d @mappings/wa-mapping.json -v POST {APIGWUrl}
Confirm that UnprocessedItems appear to be empty, which means you successfully put items into AWS DynamoDB.
In AWS DynamoDB console, click wa-mapping which you just deployed and click Explore table items.
You have now completed the first section of the Lab.
Click on Next Step to continue to the next section.
END OF SECTION 1
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool