# ApplicationVersionLifecycleConfigProperty

Use the `ApplicationVersionLifecycleConfig` property type to specify application version lifecycle settings for an AWS Elastic Beanstalk application when defining an AWS::ElasticBeanstalk::Application resource in an AWS CloudFormation template.

The application version lifecycle settings for an application. Defines the rules that Elastic Beanstalk applies to an application's versions in order to avoid hitting the per-region limit for application versions.

When Elastic Beanstalk deletes an application version from its database, you can no longer deploy that version to an environment. The source bundle remains in S3 unless you configure the rule to delete it.

`ApplicationVersionLifecycleConfig` is a property of the [ApplicationResourceLifecycleConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticbeanstalk-application-applicationresourcelifecycleconfig.html) property type.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticbeanstalk as elasticbeanstalk } from 'aws-cdk-lib';
const applicationVersionLifecycleConfigProperty: elasticbeanstalk.CfnApplication.ApplicationVersionLifecycleConfigProperty = {
  maxAgeRule: {
    deleteSourceFromS3: false,
    enabled: false,
    maxAgeInDays: 123,
  },
  maxCountRule: {
    deleteSourceFromS3: false,
    enabled: false,
    maxCount: 123,
  },
};
```

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_elasticbeanstalk as elasticbeanstalk

application_version_lifecycle_config_property = elasticbeanstalk.CfnApplication.ApplicationVersionLifecycleConfigProperty(
    max_age_rule=elasticbeanstalk.CfnApplication.MaxAgeRuleProperty(
        delete_source_from_s3=False,
        enabled=False,
        max_age_in_days=123
    ),
    max_count_rule=elasticbeanstalk.CfnApplication.MaxCountRuleProperty(
        delete_source_from_s3=False,
        enabled=False,
        max_count=123
    )
)
```

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.elasticbeanstalk.*;

ApplicationVersionLifecycleConfigProperty applicationVersionLifecycleConfigProperty = ApplicationVersionLifecycleConfigProperty.builder()
        .maxAgeRule(MaxAgeRuleProperty.builder()
                .deleteSourceFromS3(false)
                .enabled(false)
                .maxAgeInDays(123)
                .build())
        .maxCountRule(MaxCountRuleProperty.builder()
                .deleteSourceFromS3(false)
                .enabled(false)
                .maxCount(123)
                .build())
        .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.ElasticBeanstalk;

var applicationVersionLifecycleConfigProperty = new ApplicationVersionLifecycleConfigProperty {
    MaxAgeRule = new MaxAgeRuleProperty {
        DeleteSourceFromS3 = false,
        Enabled = false,
        MaxAgeInDays = 123
    },
    MaxCountRule = new MaxCountRuleProperty {
        DeleteSourceFromS3 = false,
        Enabled = false,
        MaxCount = 123
    }
};
```

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"

applicationVersionLifecycleConfigProperty := &ApplicationVersionLifecycleConfigProperty{
	MaxAgeRule: &MaxAgeRuleProperty{
		DeleteSourceFromS3: jsii.Boolean(false),
		Enabled: jsii.Boolean(false),
		MaxAgeInDays: jsii.Number(123),
	},
	MaxCountRule: &MaxCountRuleProperty{
		DeleteSourceFromS3: jsii.Boolean(false),
		Enabled: jsii.Boolean(false),
		MaxCount: jsii.Number(123),
	},
}
```

## Properties

- `maxAgeRule`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnApplication.MaxAgeRuleProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticbeanstalk.CfnApplication.MaxAgeRuleProperty.html) — Specify a max age rule to restrict the length of time that application versions are retained for an application.

- `maxCountRule`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnApplication.MaxCountRuleProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticbeanstalk.CfnApplication.MaxCountRuleProperty.html) — Specify a max count rule to restrict the number of application versions that are retained for an application.
