Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 3, 2024
1 parent 6e86355 commit b6addb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ This is very much like the prefix policy above, but for a pattern. It is an obj
}
```

This would create a policy on
This will set a policy on repos `sub app/newapp1` and `subapp/newapp2`, with 2 rules , one of which is untagged images (keep 5), and the other looking for a pattern of `*.rc.*` (keeping 5).
Note this is not the same as a pattern list (see the [docs](https://docs.aws.amazon.com/AmazonECR/latest/userguide/lpp_creation.html)) in a single rule,
which would have to match ALL the patterns. To do more complicated policies, use the [explicit](#lifecycle-policy-explicit) variable.
Expand All @@ -165,14 +164,15 @@ This is an object with several keys:
* repos: list of repositories (from the `application_list`) to apply a lifecycle policy with the policy defined in `policy`
* policy: a formatted ECR lifecycle policy JSON string

```
```hcl
lifecycle_policy_explicit = {
repos = [
"subapp/new1app3",
]
policy = data.aws_ecr_lifecycle_policy_document.pushed.json
}
}
```

This will apply a custom policy `data.aws_ecr_lifecycle_policy_document.pushed.json` to the repo `subapp/new1app3`.

Expand All @@ -181,8 +181,7 @@ This will apply a custom policy `data.aws_ecr_lifecycle_policy_document.pushed.j
* [Lifecycle Policy](examples/lifecycle-policy)

# Caveats
Currently, a destroy of the images (null_resources) does **NOT** remove the repository. That is a work in progress.
```
Currently, a destroy of the images (null\_resources) does **NOT** remove the repository. That is a work in progress.

## Requirements

Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
* }
* ```
*
* This would create a policy on
* This will set a policy on repos `sub app/newapp1` and `subapp/newapp2`, with 2 rules , one of which is untagged images (keep 5), and the other looking for a pattern of `*.rc.*` (keeping 5).
* Note this is not the same as a pattern list (see the [docs](https://docs.aws.amazon.com/AmazonECR/latest/userguide/lpp_creation.html)) in a single rule,
* which would have to match ALL the patterns. To do more complicated policies, use the [explicit](#lifecycle-policy-explicit) variable.
Expand All @@ -165,14 +164,15 @@
* * repos: list of repositories (from the `application_list`) to apply a lifecycle policy with the policy defined in `policy`
* * policy: a formatted ECR lifecycle policy JSON string
*
* ```
* ```hcl
* lifecycle_policy_explicit = {
* repos = [
* "subapp/new1app3",
* ]
* policy = data.aws_ecr_lifecycle_policy_document.pushed.json
* }
* }
* ```
*
* This will apply a custom policy `data.aws_ecr_lifecycle_policy_document.pushed.json` to the repo `subapp/new1app3`.
*
Expand Down

0 comments on commit b6addb7

Please sign in to comment.