AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Invokes the CreateDeploymentGroup operation against AWS CodeDeploy.

Syntax

New-CDDeploymentGroup
-ApplicationName <String>
-GreenFleetProvisioningOptionAction <GreenFleetProvisioningAction>
-OnSuccessBlueInstanceTerminationAction <InstanceAction>
-DeploymentReadyOptionTimeoutAction <DeploymentReadyAction>
-AlarmConfiguration_Alarm <Alarm[]>
-AutoScalingGroup <String[]>
-DeploymentConfigName <String>
-DeploymentGroupName <String>
-DeploymentStyleOption <DeploymentOption>
-DeploymentStyleType <DeploymentType>
-Ec2TagFilter <EC2TagFilter[]>
-Ec2TagSetList <EC2TagFilter[][]>
-LoadBalancerInfoList <ELBInfo[]>
-AlarmConfiguration_Enabled <Boolean>
-AutoRollbackConfiguration_Enabled <Boolean>
-AutoRollbackConfiguration_Event <String[]>
-AlarmConfiguration_IgnorePollAlarmFailure <Boolean>
-OnPremisesInstanceTagFilter <TagFilter[]>
-OnPremisesTagSetList <TagFilter[][]>
-ServiceRoleArn <String>
-LoadBalancerInfo_TargetGroupInfoList <TargetGroupInfo[]>
-OnSuccessBlueInstanceTerminationWaitTime <Int32>
-TriggerConfiguration <TriggerConfig[]>
-DeploymentReadyOptionWaitTime <Int32>
-Force <SwitchParameter>

Description

Creates a deployment group to which application revisions will be deployed.

Parameters

-AlarmConfiguration_Alarm <Alarm[]>
A list of alarms configured for the deployment group. A maximum of 10 alarms can be added to a deployment group.
Required?False
Position?Named
Accept pipeline input?False
-AlarmConfiguration_Enabled <Boolean>
Indicates whether the alarm configuration is enabled.
Required?False
Position?Named
Accept pipeline input?False
-AlarmConfiguration_IgnorePollAlarmFailure <Boolean>
Indicates whether a deployment should continue if information about the current state of alarms cannot be retrieved from Amazon CloudWatch. The default value is false.
  • true: The deployment will proceed even if alarm status information can't be retrieved from Amazon CloudWatch.
  • false: The deployment will stop if alarm status information can't be retrieved from Amazon CloudWatch.
Required?False
Position?Named
Accept pipeline input?False
-ApplicationName <String>
The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.
Required?False
Position?1
Accept pipeline input?True (ByValue, )
-AutoRollbackConfiguration_Enabled <Boolean>
Indicates whether a defined automatic rollback configuration is currently enabled.
Required?False
Position?Named
Accept pipeline input?False
-AutoRollbackConfiguration_Event <String[]>
The event type or types that trigger a rollback.
Required?False
Position?Named
Accept pipeline input?False
-AutoScalingGroup <String[]>
A list of associated Auto Scaling groups.
Required?False
Position?Named
Accept pipeline input?False
-DeploymentConfigName <String>
If specified, the deployment configuration name can be either one of the predefined configurations provided with AWS CodeDeploy or a custom deployment configuration that you create by calling the create deployment configuration operation.CodeDeployDefault.OneAtATime is the default deployment configuration. It is used if a configuration isn't specified for the deployment or the deployment group.For more information about the predefined deployment configurations in AWS CodeDeploy, see Working with Deployment Groups in AWS CodeDeploy in the AWS CodeDeploy User Guide.
Required?False
Position?Named
Accept pipeline input?False
-DeploymentGroupName <String>
The name of a new deployment group for the specified application.
Required?False
Position?Named
Accept pipeline input?False
-DeploymentReadyOptionTimeoutAction <DeploymentReadyAction>
Information about when to reroute traffic from an original environment to a replacement environment in a blue/green deployment.
  • CONTINUE_DEPLOYMENT: Register new instances with the load balancer immediately after the new application revision is installed on the instances in the replacement environment.
  • STOP_DEPLOYMENT: Do not register new instances with load balancer unless traffic is rerouted manually. If traffic is not rerouted manually before the end of the specified wait period, the deployment status is changed to Stopped.
Required?False
Position?Named
Accept pipeline input?False
-DeploymentReadyOptionWaitTime <Int32>
The number of minutes to wait before the status of a blue/green deployment changed to Stopped if rerouting is not started manually. Applies only to the STOP_DEPLOYMENT option for actionOnTimeout
Required?False
Position?Named
Accept pipeline input?False
-DeploymentStyleOption <DeploymentOption>
Indicates whether to route deployment traffic behind a load balancer.
Required?False
Position?Named
Accept pipeline input?False
-DeploymentStyleType <DeploymentType>
Indicates whether to run an in-place deployment or a blue/green deployment.
Required?False
Position?Named
Accept pipeline input?False
-Ec2TagFilter <EC2TagFilter[]>
The Amazon EC2 tags on which to filter. The deployment group will include EC2 instances with any of the specified tags. Cannot be used in the same call as ec2TagSet.
Required?False
Position?Named
Accept pipeline input?False
-Ec2TagSetList <EC2TagFilter[][]>
A list containing other lists of EC2 instance tag groups. In order for an instance to be included in the deployment group, it must be identified by all the tag groups in the list.
Required?False
Position?Named
Accept pipeline input?False
-Force <SwitchParameter>
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?False
-GreenFleetProvisioningOptionAction <GreenFleetProvisioningAction>
The method used to add instances to a replacement environment.
  • DISCOVER_EXISTING: Use instances that already exist or will be created manually.
  • COPY_AUTO_SCALING_GROUP: Use settings from a specified Auto Scaling group to define and create instances in a new Auto Scaling group.
Required?False
Position?Named
Accept pipeline input?False
-LoadBalancerInfo_TargetGroupInfoList <TargetGroupInfo[]>
An array containing information about the target group to use for load balancing in a deployment. In Elastic Load Balancing, target groups are used with Application Load Balancers.
Required?False
Position?Named
Accept pipeline input?False
-LoadBalancerInfoList <ELBInfo[]>
An array containing information about the load balancer to use for load balancing in a deployment. In Elastic Load Balancing, load balancers are used with Classic Load Balancers.
Required?False
Position?Named
Accept pipeline input?False
-OnPremisesInstanceTagFilter <TagFilter[]>
The on-premises instance tags on which to filter. The deployment group will include on-premises instances with any of the specified tags. Cannot be used in the same call as OnPremisesTagSet.
Required?False
Position?Named
Accept pipeline input?False
-OnPremisesTagSetList <TagFilter[][]>
A list containing other lists of on-premises instance tag groups. In order for an instance to be included in the deployment group, it must be identified by all the tag groups in the list.
Required?False
Position?Named
Accept pipeline input?False
-OnSuccessBlueInstanceTerminationAction <InstanceAction>
The action to take on instances in the original environment after a successful blue/green deployment.
  • TERMINATE: Instances are terminated after a specified wait time.
  • KEEP_ALIVE: Instances are left running after they are deregistered from the load balancer and removed from the deployment group.
Required?False
Position?Named
Accept pipeline input?False
-OnSuccessBlueInstanceTerminationWaitTime <Int32>
The number of minutes to wait after a successful blue/green deployment before terminating instances from the original environment.
Required?False
Position?Named
Accept pipeline input?False
-ServiceRoleArn <String>
A service role ARN that allows AWS CodeDeploy to act on the user's behalf when interacting with AWS services.
Required?False
Position?Named
Accept pipeline input?False
-TriggerConfiguration <TriggerConfig[]>
Information about triggers to create when the deployment group is created. For examples, see Create a Trigger for an AWS CodeDeploy Event in the AWS CodeDeploy User Guide.
Required?False
Position?Named
Accept pipeline input?False

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required? False
Position? Named
Accept pipeline input? False
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required? False
Position? Named
Accept pipeline input? False
-ProfileLocation <String>

Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)

If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials. Note that the encrypted credential file is not supported on all platforms. It will be skipped when searching for profiles on Windows Nano Server, Mac, and Linux platforms.

If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.

As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.

Required? False
Position? Named
Accept pipeline input? False
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required? False
Position? Named
Accept pipeline input? False
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required? False
Position? Named
Accept pipeline input? False
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required? False
Position? Named
Accept pipeline input? False
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required? False
Position? Named
Accept pipeline input? False
-Region <String>
The system name of the AWS region in which the operation should be invoked. For example, us-east-1, eu-west-1 etc.
Required? False
Position? Named
Accept pipeline input? False
-EndpointUrl <String>

The endpoint to make the call against.

Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.

Required? False
Position? Named
Accept pipeline input? False

Inputs

You can pipe a String object to this cmdlet for the ApplicationName parameter.

Outputs

This cmdlet returns a String object. The service call response (type Amazon.CodeDeploy.Model.CreateDeploymentGroupResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Examples

Example 1

PS C:\> New-CDDeploymentGroup -ApplicationName MyNewApplication -AutoScalingGroup CodeDeployDemo-ASG -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -Ec2TagFilter @{Key="Name"; Type="KEY_AND_VALUE"; Value="CodeDeployDemo"} -ServiceRoleArn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo

16bbf199-95fd-40fc-a909-0bbcfEXAMPLE
This example creates a deployment group with the specified name, Auto Scaling group, deployment configuration, tag, and service role, for the specified application.

Example 2

PS C:\> New-CDDeploymentGroup -ApplicationName MyNewApplication -AutoScalingGroup CodeDeployDemo-ASG -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -Ec2TagFilter @{Key="Name"; Type="KEY_AND_VALUE"; Value="CodeDeployDemo"} -ServiceRoleArn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo -Ec2TagSetList @(@{Key="key1";Type="KEY_ONLY"},@{Key="Key2";Type="KEY_AND_VALUE";Value="Value2"}),@(@{Key="Key3";Type="VALUE_ONLY";Value="Value3"})

16bbf199-95fd-40fc-a909-0bbcfEXAMPLE
This example shows how to specify groups of EC2 instance tags that an instance must be identified by in order for it to be included in the replacement environment for a blue/green deployment.

Supported Version

AWS Tools for PowerShell: 2.x.y.z