steampipe plugin install aws

Table: aws_codedeploy_deployment_group - Query AWS CodeDeploy Deployment Groups using SQL

The AWS CodeDeploy Deployment Group is a set of individual instances, CodeDeploy Lambda deployment configuration settings, or an EC2 tag set. It is used to represent a deployment's target, be it an instance, a Lambda function, or an EC2 instance. The Deployment Group is a key component of the AWS CodeDeploy service, which automates code deployments to any instance, including Amazon EC2 instances and servers running on-premise.

Table Usage Guide

The aws_codedeploy_deployment_group table in Steampipe provides you with information about deployment groups within AWS CodeDeploy. This table allows you as a DevOps engineer to query deployment group-specific details, including deployment configurations, target revisions, and associated alarm configurations. You can utilize this table to gather insights on deployment groups, such as deployment configuration names, target revisions, and alarm configurations. The schema outlines the various attributes of the deployment group for you, including the deployment group name, service role ARN, deployment configuration name, target revision, and associated alarm configurations.

Examples

Basic info

Explore which deployment groups are active in your AWS CodeDeploy application, including their deployment style and region. This can help identify any inconsistencies or areas for optimization in deployment strategies.

select
arn,
deployment_group_id,
deployment_group_name,
application_name,
deployment_style,
region
from
aws_codedeploy_deployment_group;
select
arn,
deployment_group_id,
deployment_group_name,
application_name,
deployment_style,
region
from
aws_codedeploy_deployment_group;

Get total deployment groups on each platform

Determine the total number of deployment groups across each computing platform. This can provide insights into the distribution of resources and help in effective resource management.

select
count(arn) as group_count,
compute_platform
from
aws_codedeploy_deployment_group
group by
compute_platform;
select
count(arn) as group_count,
compute_platform
from
aws_codedeploy_deployment_group
group by
compute_platform;

List the last successful deployment for each deployment group

Determine the status of your most recent successful deployments across different deployment groups. This can help you track your deployment history and identify any potential issues or bottlenecks in your deployment process.

select
arn,
deployment_group_id,
last_successful_deployment
from
aws_codedeploy_deployment_group;
select
arn,
deployment_group_id,
last_successful_deployment
from
aws_codedeploy_deployment_group;

Get total deployment groups based on deployment style

Analyze your deployment styles to understand the distribution of your deployment groups. This can help optimize resource allocation and improve deployment efficiency.

select
count(arn) as group_count,
deployment_style
from
aws_codedeploy_deployment_group
group by
deployment_style;
select
count(arn) as group_count,
deployment_style
from
aws_codedeploy_deployment_group
group by
deployment_style;

List the deployment groups having automatic rollback enabled

Determine the areas in which automatic rollback is enabled for deployment groups. This is useful to quickly identify configurations that can help prevent unintended changes or disruptions to services.

select
arn,
deployment_group_id,
deployment_group_name,
auto_rollback_configuration ->> 'Enabled' as auto_rollback_configuration_enabled
from
aws_codedeploy_deployment_group
where
auto_rollback_configuration ->> 'Enabled' = 'true';
select
arn,
deployment_group_id,
deployment_group_name,
json_extract(auto_rollback_configuration, '$.Enabled') as auto_rollback_configuration_enabled
from
aws_codedeploy_deployment_group
where
json_extract(auto_rollback_configuration, '$.Enabled') = 'true';

List all autoscaling groups in a particular deployment group for an application

Analyze the settings to understand the configuration of autoscaling groups within a specific deployment group for a particular application. This can be useful in managing and optimizing resource usage in your cloud environment.

select
arn as group_arn,
deployment_group_id,
deployment_group_name,
auto_scaling_groups ->> 'Hook' as auto_scaling_group_hook,
auto_scaling_groups ->> 'Name' as auto_scaling_group_name
from
aws_codedeploy_deployment_group
where
application_name = 'abc'
and deployment_group_name = 'def';
select
arn as group_arn,
deployment_group_id,
deployment_group_name,
json_extract(auto_scaling_groups, '$.Hook') as auto_scaling_group_hook,
json_extract(auto_scaling_groups, '$.Name') as auto_scaling_group_name
from
aws_codedeploy_deployment_group
where
application_name = 'abc'
and deployment_group_name = 'def';

List the deployment groups having automatic rollback enabled

Determine the areas in which automatic rollback is enabled in deployment groups. This is useful to identify and manage risk in software deployment processes.

select
arn,
deployment_group_id,
deployment_group_name,
alarm_configuration ->> 'Enabled' as alarm_configuration_enabled
from
aws_codedeploy_deployment_group
where
alarm_configuration ->> 'Enabled' = 'true';
select
arn,
deployment_group_id,
deployment_group_name,
json_extract(alarm_configuration, '$.Enabled') as alarm_configuration_enabled
from
aws_codedeploy_deployment_group
where
json_extract(alarm_configuration, '$.Enabled') = 'true';

Schema for aws_codedeploy_deployment_group

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
alarm_configurationjsonbA list of alarms associated with the deployment group.
application_nametext=The application name.
arntextThe Amazon Resource Name (ARN) specifying the application.
auto_rollback_configurationjsonbInformation about the automatic rollback configuration associated with the deployment group.
auto_scaling_groupsjsonbA list of associated Auto Scaling groups.
blue_green_deployment_configurationjsonbInformation about blue/green deployment options for a deployment group.
compute_platformjsonbThe destination platform type for the deployment (Lambda, Server, or ECS).
deployment_config_nametextThe deployment configuration name.
deployment_group_idtextThe deployment group ID.
deployment_group_nametext=The deployment group name.
deployment_stylejsonbInformation about the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer.
ec2_tag_filtersjsonbThe Amazon EC2 tags on which to filter. The deployment group includes EC2 instances with any of the specified tags.
ec2_tag_setjsonbInformation about groups of tags applied to an Amazon EC2 instance.
ecs_servicesjsonbThe target Amazon ECS services in the deployment group.
last_attempted_deploymentjsonbInformation about the most recent attempted deployment to the deployment group.
last_successful_deploymentjsonbInformation about the most recent successful deployment to the deployment group.
load_balancer_infojsonbInformation about the load balancer to use in a deployment.
on_premises_instance_tag_filtersjsonbThe on-premises instance tags on which to filter.
on_premises_tag_setjsonbInformation about groups of tags applied to an on-premises instance.
outdated_instances_strategyjsonbIndicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
service_role_arntextA service role Amazon Resource Name (ARN) that grants CodeDeploy permission to make calls to Amazon Web Services services on your behalf.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags associated with deployment group.
target_revisionjsonbInformation about the deployment group's target revision, including type and location.
termination_hook_enabledbooleanIndicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
titletextTitle of the resource.
trigger_configurationsjsonbInformation about triggers associated with the deployment group.

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_codedeploy_deployment_group