Created
July 12, 2019 11:40
-
-
Save markuman/faedd97f5c1af43c2935751103684c16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http_rules: | |
- Conditions: | |
- Field: host-header | |
Values: | |
- some.domain | |
Actions: | |
- RedirectConfig: | |
Host: "jfkdsd.cloudfront.net" | |
Path: "/#{path}" | |
Port: "443" | |
Protocol: "HTTPS" | |
Query: "#{query}" | |
StatusCode: "HTTP_301" | |
Type: redirect | |
- Conditions: | |
- Field: path-pattern | |
Values: | |
- "/AutoDiscover/autodiscover.xml" | |
Actions: | |
- FixedResponseConfig: | |
ContentType: "text/plain" | |
MessageBody: "Not found here ..." | |
StatusCode: "404" | |
Type: fixed-response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners: | |
- Protocol: HTTP | |
Port: 80 | |
DefaultActions: | |
- Type: redirect | |
RedirectConfig: | |
Protocol: HTTPS | |
Host: "#{host}" | |
Query: "#{query}" | |
Path: "/#{path}" | |
Port: "443" | |
StatusCode: HTTP_301 | |
Rules: "{{ http_rules | add_priority }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
class FilterModule(object): | |
def filters(self): | |
return { | |
'add_priority': self.add_priority | |
} | |
def add_priority(self, input): | |
retval = list() | |
counter = 1 | |
for item in input: | |
item['Priority'] = str(counter) | |
counter += 1 | |
retval.append(item) | |
return retval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment