Skip to main content

lens

Creates, updates, deletes, gets or lists a lens resource.

Overview

Namelens
TypeResource
Idaws.wellarchitected.lens

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringThe description of the lens.
lens_arnstringThe ARN of a lens.
lens_versionstringThe version of a lens.
namestringThe full name of the lens.
ownerstringThe Amazon Web Services account ID that owns the lens.
share_invitation_idstringThe ID assigned to the share invitation. (pattern: <code>[0-9a-f]{32}</code>)
tagsobjectThe tags assigned to the lens.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_lensselectlens_alias, regionLensVersionGet an existing lens.
create_lens_versioninsertlens_alias, region, LensVersion, ClientRequestTokenCreate a new lens version. A lens can have up to 100 versions. Use this operation to publish a new lens version after you have imported a lens. The LensAlias is used to identify the lens to be published. The owner of a lens can share the lens with other Amazon Web Services accounts and users in the same Amazon Web Services Region. Only the owner of a lens can delete it.
delete_lensdeletelens_alias, ClientRequestToken, LensStatus, regionDelete an existing lens. Only the owner of a lens can delete it. After the lens is deleted, Amazon Web Services accounts and users that you shared the lens with can continue to use it, but they will no longer be able to apply it to new workloads. Disclaimer By sharing your custom lenses with other Amazon Web Services accounts, you acknowledge that Amazon Web Services will make your custom lenses available to those other accounts. Those other accounts may continue to access and use your shared custom lenses even if you delete the custom lenses from your own Amazon Web Services account or terminate your Amazon Web Services account.
export_lensexeclens_alias, regionLensVersionExport an existing lens. Only the owner of a lens can export it. Lenses provided by Amazon Web Services (Amazon Web Services Official Content) cannot be exported. Lenses are defined in JSON. For more information, see JSON format specification in the Well-Architected Tool User Guide. Disclaimer Do not include or gather personal identifiable information (PII) of end users or other identifiable individuals in or via your custom lenses. If your custom lens or those shared with you and used in your account do include or collect PII you are responsible for: ensuring that the included PII is processed in accordance with applicable law, providing adequate privacy notices, and obtaining necessary consents for processing such data.
import_lensexecregion, JSONString, ClientRequestTokenImport a new custom lens or update an existing custom lens. To update an existing custom lens, specify its ARN as the LensAlias. If no ARN is specified, a new custom lens is created. The new or updated lens will have a status of DRAFT. The lens cannot be applied to workloads or shared with other Amazon Web Services accounts until it's published with CreateLensVersion. Lenses are defined in JSON. For more information, see JSON format specification in the Well-Architected Tool User Guide. A custom lens cannot exceed 500 KB in size. Disclaimer Do not include or gather personal identifiable information (PII) of end users or other identifiable individuals in or via your custom lenses. If your custom lens or those shared with you and used in your account do include or collect PII you are responsible for: ensuring that the included PII is processed in accordance with applicable law, providing adequate privacy notices, and obtaining necessary consents for processing such data.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ClientRequestTokenstring
LensStatusstringThe status of the lens to be deleted.
lens_aliasstring
regionstringAWS region (default: us-east-1)
LensVersionstringThe lens version to be exported.

SELECT examples

Get an existing lens.

SELECT
description,
lens_arn,
lens_version,
name,
owner,
share_invitation_id,
tags
FROM aws.wellarchitected.lens
WHERE lens_alias = '{{ lens_alias }}' -- required
AND region = '{{ region }}' -- required
AND LensVersion = '{{ LensVersion }}'
;

INSERT examples

Create a new lens version. A lens can have up to 100 versions. Use this operation to publish a new lens version after you have imported a lens. The LensAlias is used to identify the lens to be published. The owner of a lens can share the lens with other Amazon Web Services accounts and users in the same Amazon Web Services Region. Only the owner of a lens can delete it.

INSERT INTO aws.wellarchitected.lens (
LensVersion,
IsMajorVersion,
ClientRequestToken,
lens_alias,
region
)
SELECT
'{{ LensVersion }}' /* required */,
{{ IsMajorVersion }},
'{{ ClientRequestToken }}' /* required */,
'{{ lens_alias }}',
'{{ region }}'
RETURNING
lens_arn,
lens_version
;

DELETE examples

Delete an existing lens. Only the owner of a lens can delete it. After the lens is deleted, Amazon Web Services accounts and users that you shared the lens with can continue to use it, but they will no longer be able to apply it to new workloads. Disclaimer By sharing your custom lenses with other Amazon Web Services accounts, you acknowledge that Amazon Web Services will make your custom lenses available to those other accounts. Those other accounts may continue to access and use your shared custom lenses even if you delete the custom lenses from your own Amazon Web Services account or terminate your Amazon Web Services account.

DELETE FROM aws.wellarchitected.lens
WHERE lens_alias = '{{ lens_alias }}' --required
AND ClientRequestToken = '{{ ClientRequestToken }}' --required
AND LensStatus = '{{ LensStatus }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Export an existing lens. Only the owner of a lens can export it. Lenses provided by Amazon Web Services (Amazon Web Services Official Content) cannot be exported. Lenses are defined in JSON. For more information, see JSON format specification in the Well-Architected Tool User Guide. Disclaimer Do not include or gather personal identifiable information (PII) of end users or other identifiable individuals in or via your custom lenses. If your custom lens or those shared with you and used in your account do include or collect PII you are responsible for: ensuring that the included PII is processed in accordance with applicable law, providing adequate privacy notices, and obtaining necessary consents for processing such data.

EXEC aws.wellarchitected.lens.export_lens
@lens_alias='{{ lens_alias }}' --required,
@region='{{ region }}' --required,
@LensVersion='{{ LensVersion }}'
;