steampipe plugin install aws

Table: aws_cloudformation_stack_set - Query AWS CloudFormation StackSets using SQL

The AWS CloudFormation StackSets is a feature within the AWS CloudFormation service that allows you to create, update, or delete stacks across multiple accounts and regions with a single AWS CloudFormation template. StackSets takes care of the underlying details of orchestrating stack operations across multiple accounts and regions, ensuring that the stacks are created, updated, or deleted in a specified order. This simplifies the management of AWS resources and enables the easy deployment of regional and global applications.

Table Usage Guide

The aws_cloudformation_stack_set table in Steampipe provides you with information about StackSets within AWS CloudFormation. This table allows you, as a DevOps engineer, to query StackSet-specific details, including its configuration, status, and AWS resources associated with it. You can utilize this table to gather insights on StackSets, such as StackSets with specific configurations, their current status, and more. The schema outlines the various attributes of the StackSet for you, including the StackSet ID, description, status, template body, and associated tags.

Examples

Basic info

Explore which AWS CloudFormation stack sets are in use and their current status. This can be useful for auditing purposes, understanding your resource utilization, and identifying any potential issues with your stacks.

select
stack_set_id,
stack_set_name,
status,
arn,
description
from
aws_cloudformation_stack_set;
select
stack_set_id,
stack_set_name,
status,
arn,
description
from
aws_cloudformation_stack_set;

List active stack sets

Determine the areas in which active stack sets are being used within your AWS CloudFormation service. This allows you to monitor and manage your active resources effectively.

select
stack_set_id,
stack_set_name,
status,
permission_model,
auto_deployment
from
aws_cloudformation_stack_set
where
status = 'ACTIVE';
select
stack_set_id,
stack_set_name,
status,
permission_model,
auto_deployment
from
aws_cloudformation_stack_set
where
status = 'ACTIVE';

Get parameter details of stack sets

This query allows you to delve into the specifics of your stack sets within AWS CloudFormation. It's particularly valuable for understanding the parameters associated with each stack set, which can help in managing and optimizing your cloud resources.

select
stack_set_name,
stack_set_id,
p ->> 'ParameterKey' as parameter_key,
p ->> 'ParameterValue' as parameter_value,
p ->> 'ResolvedValue' as resolved_value,
p ->> 'UsePreviousValue' as use_previous_value
from
aws_cloudformation_stack_set,
jsonb_array_elements(parameters) as p;
select
stack_set_name,
stack_set_id,
json_extract(p.value, '$.ParameterKey') as parameter_key,
json_extract(p.value, '$.ParameterValue') as parameter_value,
json_extract(p.value, '$.ResolvedValue') as resolved_value,
json_extract(p.value, '$.UsePreviousValue') as use_previous_value
from
aws_cloudformation_stack_set,
json_each(parameters) as p;

Get drift detection details of stack sets

Explore the drift detection status of your stack sets to identify any potential issues or discrepancies. This can help in maintaining the overall health and integrity of your stack sets.

select
stack_set_name,
stack_set_id,
stack_set_drift_detection_details ->> 'DriftDetectionStatus' as drift_detection_status,
stack_set_drift_detection_details ->> 'DriftStatus' as drift_status,
stack_set_drift_detection_details ->> 'DriftedStackInstancesCount' as drifted_stack_instances_count,
stack_set_drift_detection_details ->> 'FailedStackInstancesCount' as failed_stack_instances_count,
stack_set_drift_detection_details ->> 'InProgressStackInstancesCount' as in_progress_stack_instances_count,
stack_set_drift_detection_details ->> 'InSyncStackInstancesCount' as in_sync_stack_instances_count,
stack_set_drift_detection_details ->> 'LastDriftCheckTimestamp' as last_drift_check_timestamp,
stack_set_drift_detection_details ->> 'TotalStackInstancesCount' as total_stack_instances_count
from
aws_cloudformation_stack_set;
select
stack_set_name,
stack_set_id,
json_extract(
stack_set_drift_detection_details,
'$.DriftDetectionStatus'
) as drift_detection_status,
json_extract(
stack_set_drift_detection_details,
'$.DriftStatus'
) as drift_status,
json_extract(
stack_set_drift_detection_details,
'$.DriftedStackInstancesCount'
) as drifted_stack_instances_count,
json_extract(
stack_set_drift_detection_details,
'$.FailedStackInstancesCount'
) as failed_stack_instances_count,
json_extract(
stack_set_drift_detection_details,
'$.InProgressStackInstancesCount'
) as in_progress_stack_instances_count,
json_extract(
stack_set_drift_detection_details,
'$.InSyncStackInstancesCount'
) as in_sync_stack_instances_count,
json_extract(
stack_set_drift_detection_details,
'$.LastDriftCheckTimestamp'
) as last_drift_check_timestamp,
json_extract(
stack_set_drift_detection_details,
'$.TotalStackInstancesCount'
) as total_stack_instances_count
from
aws_cloudformation_stack_set;

Schema for aws_cloudformation_stack_set

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
administration_role_arntextThe Amazon Resource Name (ARN) of the IAM role used to create or update the stack set.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Amazon Resource Name (ARN) of the stack set.
auto_deploymentjsonbDescribes whether StackSets automatically deploys to Organizations accounts that are added to a target organizational unit (OU).
capabilitiesjsonbThe capabilities that are allowed in the stack set.
descriptiontextA description of the stack set that you specify when the stack set is created or updated.
drift_statustextStatus of the stack set's actual configuration compared to its expected template and parameter configuration. A stack set is considered to have drifted if one or more of its stack instances have drifted from their expected template and parameter configuration.
execution_role_nametextThe name of the IAM execution role used to create or update the stack set.
last_drift_check_timestamptimestamp with time zoneMost recent time when CloudFormation performed a drift detection operation on the stack set.
managed_executionjsonbDescribes whether StackSets performs non-conflicting operations concurrently and queues conflicting operations.
organizational_unit_idsjsonbThe organization root ID or organizational unit (OU) IDs that you specified for DeploymentTargets.
parametersjsonbA list of input parameters for a stack set.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
permission_modeltextDescribes how the IAM roles required for stack set operations are created.
regiontextThe AWS Region in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
stack_set_drift_detection_detailsjsonbDetailed information about the drift status of the stack set.
stack_set_idtextThe ID of the stack set.
stack_set_nametext=The name of the stack set.
statustext=The status of the stack set.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags associated with stack.
template_bodytextThe structure that contains the body of the template that was used to create or update the stack set.
titletextTitle of the resource.

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_cloudformation_stack_set