Table: aws_elastic_beanstalk_environment - Query AWS Elastic Beanstalk Environments using SQL
The AWS Elastic Beanstalk Environment is a part of the AWS Elastic Beanstalk service that allows developers to deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications. This service automatically handles the capacity provisioning, load balancing, scaling, and application health monitoring. It supports applications developed in Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker.
Table Usage Guide
The aws_elastic_beanstalk_environment
table in Steampipe provides you with information about environments within AWS Elastic Beanstalk. This table allows you as a DevOps engineer to query environment-specific details, including configuration settings, environment health, related applications, and associated metadata. You can utilize this table to gather insights on environments, such as environments with specific configurations, health status, associated applications, and more. The schema outlines the various attributes of the Elastic Beanstalk environment for you, including the environment name, ID, application name, status, health, and associated tags.
Examples
Basic info
Explore the configuration of your AWS Elastic Beanstalk environments to understand their applications and tiers. This is useful for reviewing the setup and organization of your cloud applications.
select environment_id, environment_name, application_name, arn, tierfrom aws_elastic_beanstalk_environment;
select environment_id, environment_name, application_name, arn, tierfrom aws_elastic_beanstalk_environment;
List environments which have configuration updates and application version deployments in progress
Identify instances where configuration updates and application version deployments are currently in progress. This can be useful in managing and tracking ongoing operations within your environment.
select environment_name, abortable_operation_in_progressfrom aws_elastic_beanstalk_environmentwhere abortable_operation_in_progress = 'true';
select environment_name, abortable_operation_in_progressfrom aws_elastic_beanstalk_environmentwhere abortable_operation_in_progress = 'true';
List unhealthy environments
Determine the areas in which AWS Elastic Beanstalk environments are unhealthy. This query is useful for identifying and addressing problematic environments to ensure optimal application performance.
select environment_name, application_name, environment_id, healthfrom aws_elastic_beanstalk_environmentwhere health = 'Red';
select environment_name, application_name, environment_id, healthfrom aws_elastic_beanstalk_environmentwhere health = 'Red';
List environments with health monitoring disabled
Identify instances where health monitoring has been suspended in certain environments to understand potential vulnerabilities and ensure optimal performance.
select environment_name, health_statusfrom aws_elastic_beanstalk_environmentwhere health_status = 'Suspended';
select environment_name, health_statusfrom aws_elastic_beanstalk_environmentwhere health_status = 'Suspended';
List managed actions for each environment
Identify the managed actions associated with each environment in the AWS Elastic Beanstalk service. This can help in monitoring the status and type of actions, providing insights for better management and optimization of your environments.
select environment_name, a ->> 'ActionDescription' as action_description, a ->> 'ActionId' as action_id, a ->> 'ActionType' as action_type, a ->> 'Status' as action_status, a ->> 'WindowStartTime' as action_window_start_timefrom aws_elastic_beanstalk_environment, jsonb_array_elements(managed_actions) as a;
select environment_name, json_extract(a.value, '$.ActionDescription') as action_description, json_extract(a.value, '$.ActionId') as action_id, json_extract(a.value, '$.ActionType') as action_type, json_extract(a.value, '$.Status') as action_status, json_extract(a.value, '$.WindowStartTime') as action_window_start_timefrom aws_elastic_beanstalk_environment, json_each(managed_actions) as a;
list the configuration settings for each environment
Determine the areas in which configuration settings for various environments are tracked and updated. This can be used to keep track of deployment status, platform details, and other critical factors in your AWS Elastic Beanstalk environments.
select environment_name, application_name, c ->> 'DateCreated' as date_created, c ->> 'DateUpdated' as date_updated, c ->> 'DeploymentStatus' as deployment_status, c ->> 'Description' as description, c -> 'OptionSettings' ->> 'Namespace' as option_settings_namespace, c -> 'OptionSettings' ->> 'OptionName' as option_name, c -> 'OptionSettings' ->> 'ResourceName' as option_resource_name, c -> 'OptionSettings' ->> 'Value' as option_value, c ->> 'PlatformArn' as platform_arn, c ->> 'SolutionStackName' as solution_stack_name, c ->> 'TemplateName' as template_namefrom aws_elastic_beanstalk_environment, jsonb_array_elements(configuration_settings) as c;
select environment_name, application_name, json_extract(c.value, '$.DateCreated') as date_created, json_extract(c.value, '$.DateUpdated') as date_updated, json_extract(c.value, '$.DeploymentStatus') as deployment_status, json_extract(c.value, '$.Description') as description, json_extract(c.value, '$.OptionSettings.Namespace') as option_settings_namespace, json_extract(c.value, '$.OptionSettings.OptionName') as option_name, json_extract(c.value, '$.OptionSettings.ResourceName') as option_resource_name, json_extract(c.value, '$.OptionSettings.Value') as option_value, json_extract(c.value, '$.PlatformArn') as platform_arn, json_extract(c.value, '$.SolutionStackName') as solution_stack_name, json_extract(c.value, '$.TemplateName') as template_namefrom aws_elastic_beanstalk_environment, json_each(configuration_settings) as c;
Control examples
- AWS Foundational Security Best Practices > Elastic Beanstalk > 1 Elastic Beanstalk environments should have enhanced health reporting enabled
- AWS Foundational Security Best Practices > Elastic Beanstalk > 3 Elastic Beanstalk should stream logs to CloudWatch
- CIS AWS Compute Services Benchmark v1.0.0 > 6 Elastic Beanstalk > 6.2 Ensure Persistent logs is setup and configured to S3
- Elastic Beanstalk enhanced health reporting should be enabled
- Elastic Beanstalk environment should have managed updates enabled
- Elastic Beanstalk should stream logs to CloudWatch
Schema for aws_elastic_beanstalk_environment
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
abortable_operation_in_progress | boolean | Indicates if there is an in-progress environment configuration update or application version deployment that you can cancel. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
application_name | text | = | The name of the application associated with this environment. |
arn | text | The environment's Amazon Resource Name (ARN). | |
cname | text | The URL to the CNAME for this environment. | |
configuration_settings | jsonb | Returns a description of the settings for the specified configuration set, that is, either a configuration template or the configuration set associated with a running environment. | |
date_created | timestamp with time zone | The creation date for this environment. | |
date_updated | timestamp with time zone | The last modified date for this environment. | |
description | text | Describes this environment. | |
endpoint_url | text | The URL to the LoadBalancer. | |
environment_id | text | = | The ID of this environment. |
environment_links | jsonb | A list of links to other environments in the same group. | |
environment_name | text | = | The name of this environment. |
health | text | The health status of the environment. | |
health_status | text | Returns the health status of the application running in your environment. | |
managed_actions | jsonb | A list of upcoming and in-progress managed actions. | |
operations_role | text | The Amazon Resource Name (ARN) of the environment's operations role. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
platform_arn | text | The ARN of the platform version. | |
region | text | The AWS Region in which the resource is located. | |
resources | jsonb | The description of the AWS resources used by this environment. | |
solution_stack_name | text | The name of the SolutionStack deployed with this environment. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | The current operational status of the environment. | |
tags | jsonb | ||
tags_src | jsonb | A list of tags assigned to the Repository | |
template_name | text | The name of the configuration template used to originally launch this environment. | |
tier | jsonb | Describes the current tier of this environment. | |
title | text | Title of the resource. | |
version_label | text | The application version deployed in this environment. |
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_elastic_beanstalk_environment