# LifecyclePolicyProperty

The `LifecyclePolicy` property type specifies a lifecycle policy.

For information about lifecycle policy syntax, see [Lifecycle policy template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html) in the *Amazon ECR User Guide* .

- 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_ecr as ecr } from 'aws-cdk-lib';
const lifecyclePolicyProperty: ecr.CfnRepository.LifecyclePolicyProperty = {
  lifecyclePolicyText: 'lifecyclePolicyText',
  registryId: 'registryId',
};
```

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_ecr as ecr

lifecycle_policy_property = ecr.CfnRepository.LifecyclePolicyProperty(
    lifecycle_policy_text="lifecyclePolicyText",
    registry_id="registryId"
)
```

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

LifecyclePolicyProperty lifecyclePolicyProperty = LifecyclePolicyProperty.builder()
        .lifecyclePolicyText("lifecyclePolicyText")
        .registryId("registryId")
        .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.ECR;

var lifecyclePolicyProperty = new LifecyclePolicyProperty {
    LifecyclePolicyText = "lifecyclePolicyText",
    RegistryId = "registryId"
};
```

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"

lifecyclePolicyProperty := &LifecyclePolicyProperty{
	LifecyclePolicyText: jsii.String("lifecyclePolicyText"),
	RegistryId: jsii.String("registryId"),
}
```

## Properties

- `lifecyclePolicyText`: string — The JSON repository policy text to apply to the repository.

- `registryId`: string — The AWS account ID associated with the registry that contains the repository.

  If you do not specify a registry, the default registry is assumed.
