steampipe plugin install aws

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,
owner
from
aws_wellarchitected_lens;
select
lens_name,
lens_alias,
arn,
lens_status,
lens_type,
owner
from
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_type
from
aws_wellarchitected_lens;
select
distinct arn,
lens_name,
lens_status,
lens_type
from
aws_wellarchitected_lens
group 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_id
from
aws_wellarchitected_lens
where
lens_type = 'CUSTOM_SHARED';
select
lens_name,
arn,
lens_status,
lens_type,
owner,
share_invitation_id
from
aws_wellarchitected_lens
where
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,
owner
from
aws_wellarchitected_lens
where
lens_status = 'DEPRECATED';
select
lens_name,
lens_status,
lens_type,
lens_version,
owner
from
aws_wellarchitected_lens
where
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_version
from
aws_wellarchitected_lens
where
created_at <= now() - interval '30' day;
select
lens_name,
lens_status,
lens_type,
created_at,
lens_version
from
aws_wellarchitected_lens
where
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_id
from
aws_wellarchitected_lens
where
owner = account_id;
select
lens_name,
lens_status,
lens_type,
lens_version,
owner,
account_id
from
aws_wellarchitected_lens
where
owner = account_id;

Schema for aws_wellarchitected_lens

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Amazon Resource Name (ARN) of the lens.
created_attimestamp with time zoneThe date and time when the lens was created.
descriptiontextThe description of the lens.
lens_aliastextThe alias of the lens.
lens_nametext=The full name of the lens.
lens_statustext=The status of the lens.
lens_typetext=The type of the lens.
lens_versiontextThe version of the lens.
ownertextAn Amazon Web Services account ID.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
share_invitation_idtextThe ID assigned to the shared invitation.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.
updated_attimestamp with time zoneThe 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