ecr lifecyclepolicy

20 views
Skip to first unread message

dheeraj sunkarapalli

unread,
Aug 25, 2020, 10:37:29 AM8/25/20
to cloudtools-dev
I'm trying to add LifecyclePolicy with LifecyclePolicyText property.I couldn't find a way to import LifecyclePolicyText .While trying to import from LifecyclePolicy got the error shown in screenshot.Could you please help me to import LifecyclePolicyText. Can you share an example which has a rule in it.




MicrosoftTeams-image (7).png

Michael Käufl

unread,
Aug 25, 2020, 10:55:59 AM8/25/20
to dheeraj sunkarapalli, cloudtools-dev
You don't need to import it. Here's a minimal example:

```python
LifecyclePolicy(
"LifecyclePolicy",
LifecyclePolicyText=json.dumps(
{
"rules": [
{
"rulePriority": 10,
"description": "Delete untagged images 7 days
after they were pushed",
"selection": {
"tagStatus": "untagged",
"countType": "sinceImagePushed",
"countUnit": "days",
"countNumber": 7,
},
"action": {"type": "expire"},
},
],
}
),
)
```

--
*AX Semantics* GmbH – Marienstr. 23 – 70178 Stuttgart, Germany  |  Managing
Directors: Saim Alkan, Robert Weißgraeber  |  Court of Registration: AG
Stuttgart, HRB 727319

*
*
*Automated Content Writing –* 
www.ax-semantics.com/ <https://www4.ax-semantics.com>


dheeraj sunkarapalli

unread,
Aug 25, 2020, 11:02:33 AM8/25/20
to cloudtools-dev
Okay Thanks for the prompt reply.
Reply all
Reply to author
Forward
0 new messages