Table: aws_wellarchitected_lens - Query AWS Well-Architected Lens using SQL
The AWS Well-Architected Lens is a component of the AWS Well-Architected Framework that provides a set of best practices and strategies to help you optimize your use of AWS resources and services. Each Lens provides a unique perspective, focusing on specific workloads or industry verticals. By using the Lens, you can ensure your architecture aligns with the best practices defined by AWS, improving your system's performance, reliability, and cost-effectiveness.
Table Usage Guide
The aws_wellarchitected_lens
table in Steampipe provides you with information about each Well-Architected Lens within AWS Well-Architected Tool. This table allows you, as a DevOps engineer, to query lens-specific details, including lens name, description, and associated AWS Well-Architected Framework pillars. You can utilize this table to gather insights on lenses, such as their associated pillars and descriptions. The schema outlines the various attributes of the Well-Architected Lens for you, including the lens name, lens version, lens status, and associated pillars.
Examples
Basic info
Explore the various aspects of your AWS Well-Architected Framework to identify the status, type, and ownership details. This can help you understand the current configuration and effectively manage your resources.
select lens_name, lens_alias, arn, lens_status, lens_type, ownerfrom aws_wellarchitected_lens;
select lens_name, lens_alias, arn, lens_status, lens_type, ownerfrom aws_wellarchitected_lens;
List unique lenses
Explore unique lenses within your AWS Well-Architected Tool to identify their names, statuses, and types, helping you gain insights into your architectural choices and manage your workloads more effectively. When querying multiple regions in an AWS account, each region will return the AWS provided lenses. To only see unique lenses, please see the example below.
select distinct on(arn) arn, lens_name, lens_status, lens_typefrom aws_wellarchitected_lens;
select distinct arn, lens_name, lens_status, lens_typefrom aws_wellarchitected_lensgroup by arn;
List custom lenses that are shared from other AWS accounts
Discover the segments that feature custom lenses shared from other AWS accounts. This can help to understand the distribution and status of shared custom lenses, providing valuable insights into the usage patterns and ownership within your AWS environment.
select lens_name, arn, lens_status, lens_type, owner, share_invitation_idfrom aws_wellarchitected_lenswhere lens_type = 'CUSTOM_SHARED';
select lens_name, arn, lens_status, lens_type, owner, share_invitation_idfrom aws_wellarchitected_lenswhere lens_type = 'CUSTOM_SHARED';
List deprecated lenses
Explore which lenses in your AWS Well-Architected Tool are deprecated. This is useful to ensure you're not using outdated tools in your architecture.
select lens_name, lens_status, lens_type, lens_version, ownerfrom aws_wellarchitected_lenswhere lens_status = 'DEPRECATED';
select lens_name, lens_status, lens_type, lens_version, ownerfrom aws_wellarchitected_lenswhere lens_status = 'DEPRECATED';
List lenses created in the last 30 days
Discover the segments that have been recently added in the last month. This is useful for keeping track of new additions and understanding their status, type, and version.
select lens_name, lens_status, lens_type, created_at, lens_versionfrom aws_wellarchitected_lenswhere created_at <= now() - interval '30' day;
select lens_name, lens_status, lens_type, created_at, lens_versionfrom aws_wellarchitected_lenswhere created_at <= datetime('now', '-30 day');
List lenses owned by this account
This query is used to identify the lenses that are owned by a specific account in the AWS Well-Architected Framework. It's useful for assessing ownership and managing resources within an AWS environment.
select lens_name, lens_status, lens_type, lens_version, owner, account_idfrom aws_wellarchitected_lenswhere owner = account_id;
select lens_name, lens_status, lens_type, lens_version, owner, account_idfrom aws_wellarchitected_lenswhere owner = account_id;
Schema for aws_wellarchitected_lens
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) of the lens. | |
created_at | timestamp with time zone | The date and time when the lens was created. | |
description | text | The description of the lens. | |
lens_alias | text | The alias of the lens. | |
lens_name | text | = | The full name of the lens. |
lens_status | text | = | The status of the lens. |
lens_type | text | = | The type of the lens. |
lens_version | text | The version of the lens. | |
owner | text | An Amazon Web Services account ID. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
share_invitation_id | text | The ID assigned to the shared invitation. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
updated_at | timestamp with time zone | The date and time when the lens was last updated. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_wellarchitected_lens