Create a Well-Architected Workload

Overview

Well-Architected Reviews are conducted per workload. A workload identifies a set of components that deliver business value. The workload is usually the level of detail that business and technology leaders communicate about. Workloads vary in levels of architectural complexity, from static websites to architectures with multiple data stores and many components.

Creating a workload

  1. We will start with creating a Well-Architected workload to use throughout this lab.
  2. Using the create-workload API, you can create a new Well-Architected workload:
    aws wellarchitected create-workload --workload-name "WA Lab Test Workload" --description "Test Workload for WA Lab" --review-owner "John Smith" --environment "PRODUCTION" --aws-regions "us-east-1" --lenses "wellarchitected" "serverless"
    
    • The following are the required parameters for the command:
      • workload-name - This is a uniquie identifier for the workload. Must be between 3 and 100 characters.
      • description - A brief description of the workload to document its scope and intended purpose. Must be between 3 and 250 characters.
      • review-owner - The name, email address, or identifier for the primary individual or group that owns the review process. Must be between 3 and 255 characters.
      • environment - The environment in which your workload runs. This must either be PRODUCTION or PREPRODUCTION
      • aws-regions - The aws-regions in which your workload runs (us-east-1, etc).
      • lenses - The list of lenses associated with the workload. All workloads must include the “wellarchitected” lens as a base, but can include additional lenses. For this lab, we are also including the serverless lens.
        • Using the list-lenses API you can get a list of lenses: aws wellarchitected list-lenses
  3. Once the command is run, you should get a response that contains the workload json structure. This will include the following items: CreateWorkload1
    • WorkloadId - The ID assigned to the workload. This ID is unique within an AWS Region.
    • WorkloadArn - The ARN for the workload.

Finding your WorkloadId

  1. Assume you created a new workload, but you did not write down the WorkloadId to use in subsequent API calls.
  2. Using the list-workloads API, you can find the WorkloadId by using a search for the workload name prefix: aws wellarchitected list-workloads --workload-name-prefix "WA Lab"
  3. You should get back a response that includes the WorkloadId along with other information about the workload that starts with “WA Lab” FindWorkloadId1
  4. If you want to only return the WorkloadId, you can use the AWS CLI query parameter to query for the value: aws wellarchitected list-workloads --workload-name-prefix "WA Lab" --query 'WorkloadSummaries[].WorkloadId' --output text FindWorkloadId2

Using WorkloadId to remove and add lenses

  1. In the first step, we added the serverless lens to our new workload. Next, we will remove and then re-add this lens to the workload.
  2. Make sure you have the WorkloadId from the previous step and replace WorkloadId with it
  3. Using the get-workload API, lets check which lenses are associated with our workload. aws wellarchitected get-workload --workload-id "<WorkloadId>" --query 'Workload.Lenses[]' AddRemoveLens1
  4. You should see serverless listed as a lens.
  5. Using the disassociate-lenses API we will remove the serverless lens. aws wellarchitected disassociate-lenses --workload-id "<WorkloadId>" --lens-aliases "serverless"

    When you use disassociate-lenses, it will be destructive and irreversible to any questions you have answered if you have not saved a milestone. Saving a milestone is recommended before you use the disassociate-lenses API call.

  6. You will not get a response to this command, but using the get-workload API you can verify that the lens was removed. aws wellarchitected get-workload --workload-id "<WorkloadId>"
  7. You should see a response such as this, showing that you no longer have serverless listed. AddRemoveLens2
  8. Using the associate-lenses API we can add the serverless lens back into the workload. aws wellarchitected associate-lenses --workload-id "<WorkloadId>" --lens-aliases "serverless"
  9. Again, you will not see a response to this command, but we can verify that it was added by doing another get-workload aws wellarchitected get-workload --workload-id "<WorkloadId>" AddRemoveLens3