# AutoDeploymentProperty

Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organization or organizational unit (OU).

For more information, see [Enable or disable automatic deployments for StackSets in AWS Organizations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-manage-auto-deployment.html) in the *CloudFormation User Guide* .

- Source: Generated at build time
- Type last changed: v2.230.0 · 26 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudformation as cloudformation } from 'aws-cdk-lib';
const autoDeploymentProperty: cloudformation.CfnStackSet.AutoDeploymentProperty = {
  dependsOn: ['dependsOn'],
  enabled: false,
  retainStacksOnAccountRemoval: false,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudformation as cloudformation

auto_deployment_property = cloudformation.CfnStackSet.AutoDeploymentProperty(
    depends_on=["dependsOn"],
    enabled=False,
    retain_stacks_on_account_removal=False
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudformation.*;

AutoDeploymentProperty autoDeploymentProperty = AutoDeploymentProperty.builder()
        .dependsOn(List.of("dependsOn"))
        .enabled(false)
        .retainStacksOnAccountRemoval(false)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFormation;

var autoDeploymentProperty = new AutoDeploymentProperty {
    DependsOn = new [] { "dependsOn" },
    Enabled = false,
    RetainStacksOnAccountRemoval = false
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

autoDeploymentProperty := &AutoDeploymentProperty{
	DependsOn: []*string{
		jsii.String("dependsOn"),
	},
	Enabled: jsii.Boolean(false),
	RetainStacksOnAccountRemoval: jsii.Boolean(false),
}
```

## Properties

- `dependsOn`: string[] — A list of StackSet ARNs that this StackSet depends on for auto-deployment operations.

  When auto-deployment is triggered, operations will be sequenced to ensure all dependencies complete successfully before this StackSet's operation begins.

- `enabled`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — If set to `true` , StackSets automatically deploys additional stack instances to AWS Organizations accounts that are added to a target organization or organizational unit (OU) in the specified Regions.

  If an account is removed from a target organization or OU, StackSets deletes stack instances from the account in the specified Regions.

- `retainStacksOnAccountRemoval`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — If set to `true` , stack resources are retained when an account is removed from a target organization or OU.

  If set to `false` , stack resources are deleted. Specify only if `Enabled` is set to `True` .
