You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,24 @@ In CloudFront, these would result in the following order:
161
161
- `/en-us/foo`-> en-us specific origin
162
162
- `/*/foo`-> catch all origin
163
163
164
+
## WebACL Associations
165
+
166
+
When multiple ingresses share the same CloudFront distribution, the controller determines which AWS WAF WebACL (if any) to associate based on the following rules:
167
+
168
+
1. **Priority to Explicit WebACLs:**
169
+
- If any ingress in the group specifies a WebACL ARN using the annotation `cdn-origin-controller.gympass.com/cf.web-acl-arn`, that WebACL will be associated with the distribution.
170
+
- If multiple ingresses specify different WebACL ARNs, the controller will prioritize one (typically the first found, but this is not guaranteed—ensure consistency across your ingresses).
171
+
2. **No Annotation or Empty Value:**
172
+
- If no ingress in the group specifies a WebACL ARN, or if the annotation is present but empty, the controller will retain the current WebACL association on the distribution.
173
+
- This means the WebACL will not be removed automatically if you remove or clear the annotation from your ingresses.
174
+
3. **Manual Removal Required:**
175
+
- The controller **will not** remove a WebACL from an existing distribution during reconciliation. If you want to disassociate a WebACL, you must do so manually via the AWS Console or CLI.
176
+
177
+
**Best Practices:**
178
+
- Always specify the same WebACL ARN on all ingresses in a group to avoid ambiguity.
179
+
- To change the WebACL, update the annotation on at least one ingress in the group to the new ARN.
180
+
- To remove a WebACL from a distribution, remove the annotation from all ingresses and then manually disassociate the WebACL in AWS.
181
+
164
182
## Function Associations
165
183
166
184
In order to associate [Cloudfront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-functions.html) and [Lambda@Edge Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-at-the-edge.html) to your Ingress-based origins, add the `cdn-origin-controller.gympass.com/cf.function-associations` annotation.
@@ -330,7 +348,6 @@ Use the following environment variables to change the controller's behavior:
| CF_AWS_WAF | No | The Web ACL which should be associated with the distributions. Use the ID for WAF v1 and the ARN for WAF v2. | "" |
334
351
| CF_CUSTOM_TAGS | No | Comma-separated list of custom tags to be added to distributions. Example: "foo=bar,bar=foo"| "" |
335
352
| CF_DEFAULT_ORIGIN_DOMAIN | Yes | Domain of the default origin each distribution must have to route traffic to in case no custom behaviors match the request. | "" |
336
353
| CF_DESCRIPTION_TEMPLATE | No | Template of the distribution's description. Currently a single field can be accessed, `{{group}}`, which matches the CDN group under which the distribution was provisioned. | "Serve contents for {{group}} group." |
0 commit comments