--- title: "Create a cloud action for AWS | Lansweeper Platform" slug: "create-a-cloud-action-aws" description: "Create an AWS cloud action to discover assets across your AWS environment and inventory cloud infrastructure such as EC2 instances, RDS, and S3 buckets." tags: ["Lansweeper Platform", "Discovery and scanning", "Cloud Discovery"] status: "update" updated: 2026-11-19T21:15:29Z published: 2026-11-19T21:15:29Z canonical: "docs.lansweeper.com/create-a-cloud-action-aws" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lansweeper.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a cloud action - AWS Create an AWS cloud action to discover assets across your AWS environment. This lets Lansweeper inventory your cloud infrastructure (such as EC2 instances, RDS databases, and S3 buckets), so you can track resources, improve visibility, and maintain accurate asset data across hybrid environments. ## Prerequisites - You have completed the steps in [Prepare AWS for Cloud Discovery](/v1/docs/prepare-aws-for-cloud-discovery) - Your **Main account role ARN** and **Reading roles name** ## Choose which accounts to scan Before you create the action, decide how Lansweeper selects the AWS accounts to scan: - **Manually select accounts**: The default mode. Lansweeper scans only the accounts you select from the list. New accounts aren't scanned until you add them to the action. - **Automatically discover all accounts**: Lansweeper scans every account your credentials can read, except the ones you exclude with rules. New accounts are scanned the next time the action runs, without editing the action. Automatic discovery is available only when you select **Organization**. With **Standalone account**, Lansweeper can't list other accounts, so you select the accounts manually. You can switch modes later by editing the action. ## Create an AWS cloud action 1. In your Lansweeper Site, go to **Discovery > Actions**. 2. Select **Create action**. 3. Select **Cloud** as the action type. 4. In the pop-up, select **Cloud provider - Amazon Web Services (AWS)** as the cloud source. 5. Select **Create**. 6. Enter your **Main account role ARN** and **Reading roles name**. 7. Select either **Standalone account** or **Organization**. 8. Select **List accounts**. 9. Choose the accounts to scan: - If you selected **Standalone account**, select the accounts from the list. - If you selected **Organization**, select **Manually select accounts** and pick the accounts from the list, or select **Automatically discover all accounts**. With automatic discovery, you can [exclude accounts with rules](/docs/create-a-cloud-action-aws#exclude-accounts-from-automatic-discovery). 10. Under **Asset types**, select which workloads to scan. 11. Under **Regions**, select the regions to include in the scan. 12. Optionally, select **Add tag filter** to include or exclude resources with specific tags. 13. Select **Create trigger**. 14. Select **Instant** to run at a scheduled time on select days. Enter the name, time, and days you prefer. 15. Finally, select **Save and finish**. ## Exclude accounts from automatic discovery When you use **Automatically discover all accounts**, you can add up to 5 rules to leave specific accounts out. 1. Select **Add exclusion rule**. 2. Under **Match on**, select **Account name** or **Account ID**. 3. Under **Regex pattern**, enter a regular expression, for example `^sandbox-`. Patterns are case-sensitive and match anywhere in the name or ID unless you anchor them with `^` or `$`. 4. Check the **Preview** list. Excluded accounts are grayed out and tagged with the rule that matches them, for example **Rule 1**. To remove a rule, select the trash can icon in its row. ## What to expect after the action runs After the trigger runs for the first time, Lansweeper discovers the resources in the regions you selected, across the AWS accounts the action scans, and adds them to your asset inventory. Each discovered resource, such as an EC2 instance, RDS database, or S3 bucket, becomes an asset with its own asset page showing details, relationships, and tags. Discovery runs on the schedule you set in the trigger, so the data refreshes with each successful run. ## Troubleshoot the AWS cloud action Where to see scan problems If a discovered asset is missing data, open the asset and check the **Scan issues** tab. Permission or scanning problems for that asset appear there. If the action doesn't return the results you expect, check the following: - **Connection or authentication fails.** Confirm your **Main account role ARN** and **Reading roles name** are correct, and that the OIDC identity provider, main role, and trust policies are configured as described in [Prepare AWS for Cloud Discovery](/v1/docs/prepare-aws-for-cloud-discovery). - **No accounts or assets are discovered.** Confirm the main account has the accounts listing policy, and that each target account has the reading role, using the same role name across all accounts, with the reading policy attached. Verify you selected **Standalone account** or **Organization** to match your setup. If you use automatic discovery, check that no exclusion rule matches the accounts you expect to see. - **Kubernetes detail is missing for EKS clusters.** Reading EKS clusters at the Kubernetes level, such as nodes, pods, and services, needs extra access to the cluster's Kubernetes API, as described in [Prepare AWS for Cloud Discovery](/v1/docs/prepare-aws-for-cloud-discovery).