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, regionfrom aws_codedeploy_deployment_group;
select arn, deployment_group_id, deployment_group_name, application_name, deployment_style, regionfrom 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_platformfrom aws_codedeploy_deployment_groupgroup by compute_platform;
select count(arn) as group_count, compute_platformfrom aws_codedeploy_deployment_groupgroup 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_deploymentfrom aws_codedeploy_deployment_group;
select arn, deployment_group_id, last_successful_deploymentfrom 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_stylefrom aws_codedeploy_deployment_groupgroup by deployment_style;
select count(arn) as group_count, deployment_stylefrom aws_codedeploy_deployment_groupgroup 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_enabledfrom aws_codedeploy_deployment_groupwhere auto_rollback_configuration ->> 'Enabled' = 'true';
select arn, deployment_group_id, deployment_group_name, json_extract(auto_rollback_configuration, '$.Enabled') as auto_rollback_configuration_enabledfrom aws_codedeploy_deployment_groupwhere 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_namefrom aws_codedeploy_deployment_groupwhere 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_namefrom aws_codedeploy_deployment_groupwhere 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_enabledfrom aws_codedeploy_deployment_groupwhere alarm_configuration ->> 'Enabled' = 'true';
select arn, deployment_group_id, deployment_group_name, json_extract(alarm_configuration, '$.Enabled') as alarm_configuration_enabledfrom aws_codedeploy_deployment_groupwhere json_extract(alarm_configuration, '$.Enabled') = 'true';
Schema for aws_codedeploy_deployment_group
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
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. | |
alarm_configuration | jsonb | A list of alarms associated with the deployment group. | |
application_name | text | = | The application name. |
arn | text | The Amazon Resource Name (ARN) specifying the application. | |
auto_rollback_configuration | jsonb | Information about the automatic rollback configuration associated with the deployment group. | |
auto_scaling_groups | jsonb | A list of associated Auto Scaling groups. | |
blue_green_deployment_configuration | jsonb | Information about blue/green deployment options for a deployment group. | |
compute_platform | jsonb | The destination platform type for the deployment (Lambda, Server, or ECS). | |
deployment_config_name | text | The deployment configuration name. | |
deployment_group_id | text | The deployment group ID. | |
deployment_group_name | text | = | The deployment group name. |
deployment_style | jsonb | Information 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_filters | jsonb | The Amazon EC2 tags on which to filter. The deployment group includes EC2 instances with any of the specified tags. | |
ec2_tag_set | jsonb | Information about groups of tags applied to an Amazon EC2 instance. | |
ecs_services | jsonb | The target Amazon ECS services in the deployment group. | |
last_attempted_deployment | jsonb | Information about the most recent attempted deployment to the deployment group. | |
last_successful_deployment | jsonb | Information about the most recent successful deployment to the deployment group. | |
load_balancer_info | jsonb | Information about the load balancer to use in a deployment. | |
on_premises_instance_tag_filters | jsonb | The on-premises instance tags on which to filter. | |
on_premises_tag_set | jsonb | Information about groups of tags applied to an on-premises instance. | |
outdated_instances_strategy | jsonb | Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
service_role_arn | text | A service role Amazon Resource Name (ARN) that grants CodeDeploy permission to make calls to Amazon Web Services services on your behalf. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags associated with deployment group. | |
target_revision | jsonb | Information about the deployment group's target revision, including type and location. | |
termination_hook_enabled | boolean | Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group. | |
title | text | Title of the resource. | |
trigger_configurations | jsonb | Information 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