# ServerDeploymentGroupProps

Construction properties for `ServerDeploymentGroup`.

Used as props by: [ServerDeploymentGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.ServerDeploymentGroup.html)

- Source: [`aws-codedeploy/lib/server/deployment-group.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-codedeploy/lib/server/deployment-group.ts#L137)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

TypeScript:

```ts
declare const alb: elbv2.ApplicationLoadBalancer;
const listener = alb.addListener('Listener', { port: 80 });
const targetGroup = listener.addTargets('Fleet', { port: 80 });

const deploymentGroup = new codedeploy.ServerDeploymentGroup(this, 'DeploymentGroup', {
  loadBalancer: codedeploy.LoadBalancer.application(targetGroup),
});
```

Python:

```python
# alb: elbv2.ApplicationLoadBalancer

listener = alb.add_listener("Listener", port=80)
target_group = listener.add_targets("Fleet", port=80)

deployment_group = codedeploy.ServerDeploymentGroup(self, "DeploymentGroup",
    load_balancer=codedeploy.LoadBalancer.application(target_group)
)
```

Java:

```java
ApplicationLoadBalancer alb;

ApplicationListener listener = alb.addListener("Listener", BaseApplicationListenerProps.builder().port(80).build());
ApplicationTargetGroup targetGroup = listener.addTargets("Fleet", AddApplicationTargetsProps.builder().port(80).build());

ServerDeploymentGroup deploymentGroup = ServerDeploymentGroup.Builder.create(this, "DeploymentGroup")
        .loadBalancer(LoadBalancer.application(targetGroup))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
ApplicationLoadBalancer alb;

var listener = alb.AddListener("Listener", new BaseApplicationListenerProps { Port = 80 });
var targetGroup = listener.AddTargets("Fleet", new AddApplicationTargetsProps { Port = 80 });

var deploymentGroup = new ServerDeploymentGroup(this, "DeploymentGroup", new ServerDeploymentGroupProps {
    LoadBalancer = LoadBalancer.Application(targetGroup)
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var alb ApplicationLoadBalancer

listener := alb.AddListener(jsii.String("Listener"), &BaseApplicationListenerProps{
	Port: jsii.Number(80),
})
targetGroup := listener.AddTargets(jsii.String("Fleet"), &AddApplicationTargetsProps{
	Port: jsii.Number(80),
})

deploymentGroup := codedeploy.NewServerDeploymentGroup(this, jsii.String("DeploymentGroup"), &ServerDeploymentGroupProps{
	LoadBalancer: codedeploy.LoadBalancer_Application(targetGroup),
})
```

## Properties

- `alarms`: [IAlarmRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cloudwatch.IAlarmRef.html)[] = [] — The CloudWatch alarms associated with this Deployment Group.

  CodeDeploy will stop (and optionally roll back)
  a deployment if during it any of the alarms trigger.

  Alarms can also be added after the Deployment Group is created using the `#addAlarm` method.

- `application`: [IApplicationRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_codedeploy.IApplicationRef.html) — The CodeDeploy EC2/on-premise Application this Deployment Group belongs to.

  **Default:** A new Application will be created.

- `autoRollback`: [AutoRollbackConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.AutoRollbackConfig.html) — The auto-rollback configuration for this Deployment Group.

  **Default:** default AutoRollbackConfig.

- `autoScalingGroups`: [IAutoScalingGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.IAutoScalingGroup.html)[] = [] — The auto-scaling groups belonging to this Deployment Group.

  Auto-scaling groups can also be added after the Deployment Group is created
  using the `#addAutoScalingGroup` method.

  [disable-awslint:ref-via-interface] is needed because we update userdata
  for ASGs to install the codedeploy agent.

- `deploymentConfig`: [IDeploymentConfigRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_codedeploy.IDeploymentConfigRef.html) — The EC2/on-premise Deployment Configuration to use for this Deployment Group.

  **Default:** ServerDeploymentConfig#OneAtATime

- `deploymentGroupName`: string — The physical, human-readable name of the CodeDeploy Deployment Group.

  **Default:** An auto-generated name will be used.

- `ec2InstanceTags`: [InstanceTagSet](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.InstanceTagSet.html) — All EC2 instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.

  **Default:** No additional EC2 instances will be added to the Deployment Group.

- `ignoreAlarmConfiguration`: boolean = false — Whether to skip the step of checking CloudWatch alarms during the deployment process.

- `ignorePollAlarmsFailure`: boolean = false — Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.

- `installAgent`: boolean = true — If you've provided any auto-scaling groups with the `#autoScalingGroups` property, you can set this property to add User Data that installs the CodeDeploy agent on the instances.

- `loadBalancer`: [LoadBalancer](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.LoadBalancer.html) — - Use `loadBalancers` instead.

  **Default:** Deployment Group will not have a load balancer defined.

  Can be created from either a classic Elastic Load Balancer,
  or an Application Load Balancer / Network Load Balancer Target Group.

- `loadBalancers`: [LoadBalancer](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.LoadBalancer.html)[] — CodeDeploy supports the deployment to multiple load balancers.

  **Default:** Deployment Group will not have load balancers defined.

  Specify either multiple Classic Load Balancers, or
  Application Load Balancers / Network Load Balancers Target Groups.

- `onPremiseInstanceTags`: [InstanceTagSet](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.InstanceTagSet.html) — All on-premise instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.

  **Default:** No additional on-premise instances will be added to the Deployment Group.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The service Role of this Deployment Group.

  **Default:** A new Role will be created.

- `terminationHook`: boolean = false — Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
