> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Cloud Query

## Background[​](#background "Direct link to Background")

The *Run AWS Cloud Query* Action performs [Steampipe queries](https://hub.steampipe.io/plugins/turbot/aws) on AWS resources with a powerful and simple PostgreSQL syntax.

For example, a complicated action such as fetching all of your EC2 instances IDs in AWS across all regions can be done simply:

```
select instance_id from aws_ec2_instance
```

To check if MFA is enabled for all users in an AWS account, use the following query:

```
select  title,  create_date,  mfa_enabledfrom  aws_iam_user
```

A query that fetches a list of AWS S3 buckets with disabled logging might look like this:

```
select  arn as resource,  case    when logging -> 'TargetBucket' is null then 'alarm'    else 'ok'  end as status,  case    when logging -> 'TargetBucket' is null then title || ' logging disabled.'    else title || ' logging enabled.'  end as reasonfrom  aws_s3_bucket;
```

A full description of all existing tables and official examples are provided here:

* [The Official AWS Plugin Documentation](https://hub.steampipe.io/plugins/turbot/aws/tables)
* [The Blink Automation Library](https://library.blinkops.com/workflows?vendors=AWS\&level=basic)

<Info>
  Blink supports Steampipe v0.92.1.
</Info>

## Action Parameters[​](#action-parameters "Direct link to Action Parameters")

| Parameter             | Description                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SQL Statement         | The SQL query to execute against AWS cloud resources. Use standard SQL syntax.                                                                                                                                                                                                                                                                                                      |
| Regions               | AWS regions to target for the query.<br /><br />This parameter supports multiple formats:<br />• All regions: `*` (default)<br />• Single region: `us-east-1`<br />• Multiple specific regions: `us-east-1,eu-west-1,ap-southeast-2`<br />• Wildcard patterns: `us-*` (all US regions), `eu-*` (all EU regions)<br />• Pattern matching: `us-??st-1` (matches us-east-1, us-west-1) |
| Output Format         | The representation of the output result.                                                                                                                                                                                                                                                                                                                                            |
| AWS Plugin Version    | The Steampipe AWS plugin version used to execute the query. Different versions may support different AWS services and features.                                                                                                                                                                                                                                                     |
| Environment Variables | Environment variables, defined as key-value pairs, to pass to the query execution context.                                                                                                                                                                                                                                                                                          |

<img src="https://mintcdn.com/blinkops-2/deay2AiePWJDKGEh/img/Actions/Steampipe/RunAWSCloudQuery.png?fit=max&auto=format&n=deay2AiePWJDKGEh&q=85&s=2df9cd9631c0e665463f6f51a3328e3f" alt="RunAWSCloudQuery" width="890" height="396" data-path="img/Actions/Steampipe/RunAWSCloudQuery.png" />
