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, descriptionfrom aws_cloudformation_stack_set;
select stack_set_id, stack_set_name, status, arn, descriptionfrom 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_deploymentfrom aws_cloudformation_stack_setwhere status = 'ACTIVE';
select stack_set_id, stack_set_name, status, permission_model, auto_deploymentfrom aws_cloudformation_stack_setwhere 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_valuefrom 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_valuefrom 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_countfrom 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_countfrom aws_cloudformation_stack_set;
Schema for aws_cloudformation_stack_set
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
administration_role_arn | text | The Amazon Resource Name (ARN) of the IAM role used to create or update the stack set. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) of the stack set. | |
auto_deployment | jsonb | Describes whether StackSets automatically deploys to Organizations accounts that are added to a target organizational unit (OU). | |
capabilities | jsonb | The capabilities that are allowed in the stack set. | |
description | text | A description of the stack set that you specify when the stack set is created or updated. | |
drift_status | text | Status 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_name | text | The name of the IAM execution role used to create or update the stack set. | |
last_drift_check_timestamp | timestamp with time zone | Most recent time when CloudFormation performed a drift detection operation on the stack set. | |
managed_execution | jsonb | Describes whether StackSets performs non-conflicting operations concurrently and queues conflicting operations. | |
organizational_unit_ids | jsonb | The organization root ID or organizational unit (OU) IDs that you specified for DeploymentTargets. | |
parameters | jsonb | A list of input parameters for a stack set. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
permission_model | text | Describes how the IAM roles required for stack set operations are created. | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
stack_set_drift_detection_details | jsonb | Detailed information about the drift status of the stack set. | |
stack_set_id | text | The ID of the stack set. | |
stack_set_name | text | = | The name of the stack set. |
status | text | = | The status of the stack set. |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags associated with stack. | |
template_body | text | The structure that contains the body of the template that was used to create or update the stack set. | |
title | text | Title 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