# MaxAgeRuleProperty

Use the `MaxAgeRule` property type to specify a max age rule to restrict the length of time that application versions are retained for an AWS Elastic Beanstalk application when defining an AWS::ElasticBeanstalk::Application resource in an AWS CloudFormation template.

A lifecycle rule that deletes application versions after the specified number of days.

`MaxAgeRule` is a property of the [ApplicationVersionLifecycleConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticbeanstalk-application-applicationversionlifecycleconfig.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 maxAgeRuleProperty: elasticbeanstalk.CfnApplication.MaxAgeRuleProperty = {
  deleteSourceFromS3: false,
  enabled: false,
  maxAgeInDays: 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

max_age_rule_property = elasticbeanstalk.CfnApplication.MaxAgeRuleProperty(
    delete_source_from_s3=False,
    enabled=False,
    max_age_in_days=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.*;

MaxAgeRuleProperty maxAgeRuleProperty = MaxAgeRuleProperty.builder()
        .deleteSourceFromS3(false)
        .enabled(false)
        .maxAgeInDays(123)
        .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 maxAgeRuleProperty = new MaxAgeRuleProperty {
    DeleteSourceFromS3 = false,
    Enabled = false,
    MaxAgeInDays = 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"

maxAgeRuleProperty := &MaxAgeRuleProperty{
	DeleteSourceFromS3: jsii.Boolean(false),
	Enabled: jsii.Boolean(false),
	MaxAgeInDays: jsii.Number(123),
}
```

## Properties

- `deleteSourceFromS3`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Set to `true` to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Specify `true` to apply the rule, or `false` to disable it.

- `maxAgeInDays`: number — Specify the number of days to retain an application versions.
