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

Calls the AWS CodeDeploy CreateDeploymentGroup API operation.

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[][]>
-EcsService <ECSService[]>
-LoadBalancerInfoList <ELBInfo[]>
-AlarmConfiguration_Enabled <Boolean>
-AutoRollbackConfiguration_Enabled <Boolean>
-AutoRollbackConfiguration_Event <String[]>
-AlarmConfiguration_IgnorePollAlarmFailure <Boolean>
-OnPremisesInstanceTagFilter <TagFilter[]>
-OnPremisesTagSetList <TagFilter[][]>
-OutdatedInstancesStrategy <OutdatedInstancesStrategy>
-ServiceRoleArn <String>
-Tag <Tag[]>
-LoadBalancerInfo_TargetGroupInfoList <TargetGroupInfo[]>
-LoadBalancerInfo_TargetGroupPairInfoList <TargetGroupPairInfo[]>
-TerminationHookEnabled <Boolean>
-OnSuccessBlueInstanceTerminationWaitTime <Int32>
-TriggerConfiguration <TriggerConfig[]>
-DeploymentReadyOptionWaitTime <Int32>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonCodeDeployConfig>

Description

Creates a deployment group to which application revisions are deployed.

Parameters

-AlarmConfiguration_Alarm <Alarm[]>
A list of alarms configured for the deployment or deployment group. A maximum of 10 alarms can be added.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAlarmConfiguration_Alarms
-AlarmConfiguration_Enabled <Boolean>
Indicates whether the alarm configuration is enabled.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-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 proceeds even if alarm status information can't be retrieved from Amazon CloudWatch.
  • false: The deployment stops if alarm status information can't be retrieved from Amazon CloudWatch.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ApplicationName <String>
The name of an CodeDeploy application associated with the user or Amazon Web Services account.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-AutoRollbackConfiguration_Enabled <Boolean>
Indicates whether a defined automatic rollback configuration is currently enabled.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-AutoRollbackConfiguration_Event <String[]>
The event type or types that trigger a rollback.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAutoRollbackConfiguration_Events
-AutoScalingGroup <String[]>
A list of associated Amazon EC2 Auto Scaling groups.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAutoScalingGroups
-ClientConfig <AmazonCodeDeployConfig>
Amazon.PowerShell.Cmdlets.CD.AmazonCodeDeployClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DeploymentConfigName <String>
If specified, the deployment configuration name can be either one of the predefined configurations provided with 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 deployment group.For more information about the predefined deployment configurations in CodeDeploy, see Working with Deployment Configurations in CodeDeploy in the CodeDeploy User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DeploymentGroupName <String>
The name of a new deployment group for the specified application.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-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 a load balancer unless traffic rerouting is started using ContinueDeployment. If traffic rerouting is not started before the end of the specified wait period, the deployment status is changed to Stopped.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesBlueGreenDeploymentConfiguration_DeploymentReadyOption_ActionOnTimeout, DeploymentReadyOption_ActionOnTimeout
-DeploymentReadyOptionWaitTime <Int32>
The number of minutes to wait before the status of a blue/green deployment is 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?True (ByPropertyName)
AliasesBlueGreenDeploymentConfiguration_DeploymentReadyOption_WaitTimeInMinutes, DeploymentReadyOption_WaitTimeInMinute
-DeploymentStyleOption <DeploymentOption>
Indicates whether to route deployment traffic behind a load balancer.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesDeploymentStyle_DeploymentOption
-DeploymentStyleType <DeploymentType>
Indicates whether to run an in-place deployment or a blue/green deployment.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesDeploymentStyle_DeploymentType
-Ec2TagFilter <EC2TagFilter[]>
The Amazon EC2 tags on which to filter. The deployment group includes Amazon EC2 instances with any of the specified tags. Cannot be used in the same call as ec2TagSet.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesEc2TagFilters
-Ec2TagSetList <EC2TagFilter[][]>
A list that contains other lists of Amazon EC2 instance tag groups. For an instance to be included in the deployment group, it must be identified by all of the tag groups in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-EcsService <ECSService[]>
The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name pair using the format <clustername>:<servicename>.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesEcsServices
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?True (ByPropertyName)
-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?True (ByPropertyName)
AliasesBlueGreenDeploymentConfiguration_GreenFleetProvisioningOption_Action, GreenFleetProvisioningOption_Action
-LoadBalancerInfo_TargetGroupInfoList <TargetGroupInfo[]>
An array that contains information about the target groups to use for load balancing in a deployment. If you're using Application Load Balancers and Network Load Balancers, specify their associated target groups in this array.You can add up to 10 target groups to the array.If you're using Classic Load Balancers, use the elbInfoList array instead of this one.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoadBalancerInfo_TargetGroupPairInfoList <TargetGroupPairInfo[]>
The target group pair information. This is an array of TargeGroupPairInfo objects with a maximum size of one.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoadBalancerInfoList <ELBInfo[]>
An array that contains information about the load balancers to use for load balancing in a deployment. If you're using Classic Load Balancers, specify those load balancers in this array. You can add up to 10 load balancers to the array.If you're using Application Load Balancers or Network Load Balancers, use the targetGroupInfoList array instead of this one.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLoadBalancerInfo_ElbInfoList
-OnPremisesInstanceTagFilter <TagFilter[]>
The on-premises instance tags on which to filter. The deployment group includes 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?True (ByPropertyName)
AliasesOnPremisesInstanceTagFilters
-OnPremisesTagSetList <TagFilter[][]>
A list that contains other lists of on-premises instance tag groups. For an instance to be included in the deployment group, it must be identified by all of the tag groups in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-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?True (ByPropertyName)
AliasesBlueGreenDeploymentConfiguration_TerminateBlueInstancesOnDeploymentSuccess_Action, TerminateBlueInstancesOnDeploymentSuccess_Action
-OnSuccessBlueInstanceTerminationWaitTime <Int32>
For an Amazon EC2 deployment, the number of minutes to wait after a successful blue/green deployment before terminating instances from the original environment. For an Amazon ECS deployment, the number of minutes before deleting the original (blue) task set. During an Amazon ECS deployment, CodeDeploy shifts traffic from the original (blue) task set to a replacement (green) task set. The maximum setting is 2880 minutes (2 days).
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesBlueGreenDeploymentConfiguration_TerminateBlueInstancesOnDeploymentSuccess_TerminationWaitTimeInMinutes, TerminateBlueInstancesOnDeploymentSuccess_TerminationWaitTimeInMinute
-OutdatedInstancesStrategy <OutdatedInstancesStrategy>
Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision.If this option is set to UPDATE or is unspecified, CodeDeploy initiates one or more 'auto-update outdated instances' deployments to apply the deployed application revision to the new Amazon EC2 instances.If this option is set to IGNORE, CodeDeploy does not initiate a deployment to update the new Amazon EC2 instances. This may result in instances having different revisions.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the ApplicationName parameter. The -PassThru parameter is deprecated, use -Select '^ApplicationName' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'DeploymentGroupId'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.CodeDeploy.Model.CreateDeploymentGroupResponse). Specifying the name of a property of type Amazon.CodeDeploy.Model.CreateDeploymentGroupResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ServiceRoleArn <String>
A service role Amazon Resource Name (ARN) that allows CodeDeploy to act on the user's behalf when interacting with Amazon Web Services services.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Tag[]>
The metadata that you apply to CodeDeploy deployment groups to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags
-TerminationHookEnabled <Boolean>
This parameter only applies if you are using CodeDeploy with Amazon EC2 Auto Scaling. For more information, see Integrating CodeDeploy with Amazon EC2 Auto Scaling in the CodeDeploy User Guide.Set terminationHookEnabled to true to have CodeDeploy install a termination hook into your Auto Scaling group when you create a deployment group. When this hook is installed, CodeDeploy will perform termination deployments.For information about termination deployments, see Enabling termination deployments during Auto Scaling scale-in events in the CodeDeploy User Guide.For more information about Auto Scaling scale-in events, see the Scale in topic in the Amazon EC2 Auto Scaling User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-TriggerConfiguration <TriggerConfig[]>
Information about triggers to create when the deployment group is created. For examples, see Create a Trigger for an CodeDeploy Event in the CodeDeploy User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTriggerConfigurations

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?True (ByPropertyName)
AliasesAK
-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?True (ByValue, ByPropertyName)
-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?True (ByPropertyName)
-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?True (ByValue, ByPropertyName)
-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.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?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-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?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-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?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns a System.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

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

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