import yaml
 
print(open('cfSchema/originRequest.yaml').read())
Records:
- cf:
    config:
      distributionDomainName: d111111abcdef8.cloudfront.net
      distributionId: EDFDVBD6EXAMPLE
      eventType: origin-request
      requestId: 4TyzHTaYWb1GX1qTfsHhEqV6HUDd_BzoBZnwfnvQc_1oF26ClkoUSEQ==
    request:
      clientIp: 203.0.113.178
      headers:
        cache-control:
        - key: Cache-Control
          value: no-cache, cf-no-cache
        host:
        - key: Host
          value: example.org
        user-agent:
        - key: User-Agent
          value: Amazon CloudFront
        via:
        - key: Via
          value: 2.0 2afae0d44e2540f472c0635ab62c232b.cloudfront.net (CloudFront)
        x-forwarded-for:
        - key: X-Forwarded-For
          value: 203.0.113.178
      method: GET
      origin:
        custom:
          customHeaders: {}
          domainName: example.org
          keepaliveTimeout: 5
          path: ''
          port: 443
          protocol: https
          readTimeout: 30
          sslProtocols:
          - TLSv1
          - TLSv1.1
          - TLSv1.2
      querystring: ''
      uri: /

Origin Response

print(open('cfSchema/originResponse.yaml').read())
Records:
- cf:
    config:
      distributionDomainName: d111111abcdef8.cloudfront.net
      distributionId: EDFDVBD6EXAMPLE
      eventType: origin-response
      requestId: 4TyzHTaYWb1GX1qTfsHhEqV6HUDd_BzoBZnwfnvQc_1oF26ClkoUSEQ==
    request:
      clientIp: 203.0.113.178
      headers:
        cache-control:
        - key: Cache-Control
          value: no-cache, cf-no-cache
        host:
        - key: Host
          value: example.org
        user-agent:
        - key: User-Agent
          value: Amazon CloudFront
        via:
        - key: Via
          value: 2.0 8f22423015641505b8c857a37450d6c0.cloudfront.net (CloudFront)
        x-forwarded-for:
        - key: X-Forwarded-For
          value: 203.0.113.178
      method: GET
      origin:
        custom:
          customHeaders: {}
          domainName: example.org
          keepaliveTimeout: 5
          path: ''
          port: 443
          protocol: https
          readTimeout: 30
          sslProtocols:
          - TLSv1
          - TLSv1.1
          - TLSv1.2
      querystring: ''
      uri: /
    response:
      headers:
        access-control-allow-credentials:
        - key: Access-Control-Allow-Credentials
          value: 'true'
        access-control-allow-origin:
        - key: Access-Control-Allow-Origin
          value: '*'
        content-length:
        - key: Content-Length
          value: '9593'
        content-type:
        - key: Content-Type
          value: text/html; charset=utf-8
        date:
        - key: Date
          value: Mon, 13 Jan 2020 20:12:38 GMT
        referrer-policy:
        - key: Referrer-Policy
          value: no-referrer-when-downgrade
        server:
        - key: Server
          value: ExampleCustomOriginServer
        x-content-type-options:
        - key: X-Content-Type-Options
          value: nosniff
        x-frame-options:
        - key: X-Frame-Options
          value: DENY
        x-xss-protection:
        - key: X-XSS-Protection
          value: 1; mode=block
      status: '200'
      statusDescription: OK

Viewer Request

print(open('cfSchema/viewerRequest.yaml').read())
Records:
- cf:
    config:
      distributionDomainName: d111111abcdef8.cloudfront.net
      distributionId: EDFDVBD6EXAMPLE
      eventType: viewer-request
      requestId: 4TyzHTaYWb1GX1qTfsHhEqV6HUDd_BzoBZnwfnvQc_1oF26ClkoUSEQ==
    request:
      clientIp: 203.0.113.178
      headers:
        accept:
        - key: accept
          value: '*/*'
        host:
        - key: Host
          value: d111111abcdef8.cloudfront.net
        user-agent:
        - key: User-Agent
          value: curl/7.66.0
      method: GET
      querystring: ''
      uri: /

Viewer Response

print(open('cfSchema/viewerResponse.yaml').read())
Records:
- cf:
    config:
      distributionDomainName: d111111abcdef8.cloudfront.net
      distributionId: EDFDVBD6EXAMPLE
      eventType: viewer-response
      requestId: 4TyzHTaYWb1GX1qTfsHhEqV6HUDd_BzoBZnwfnvQc_1oF26ClkoUSEQ==
    request:
      clientIp: 203.0.113.178
      headers:
        accept:
        - key: accept
          value: '*/*'
        host:
        - key: Host
          value: d111111abcdef8.cloudfront.net
        user-agent:
        - key: User-Agent
          value: curl/7.66.0
      method: GET
      querystring: ''
      uri: /
    response:
      headers:
        access-control-allow-credentials:
        - key: Access-Control-Allow-Credentials
          value: 'true'
        access-control-allow-origin:
        - key: Access-Control-Allow-Origin
          value: '*'
        age:
        - key: Age
          value: '2402'
        content-length:
        - key: Content-Length
          value: '9593'
        content-type:
        - key: Content-Type
          value: text/html; charset=utf-8
        date:
        - key: Date
          value: Mon, 13 Jan 2020 20:14:56 GMT
        referrer-policy:
        - key: Referrer-Policy
          value: no-referrer-when-downgrade
        server:
        - key: Server
          value: ExampleCustomOriginServer
        x-content-type-options:
        - key: X-Content-Type-Options
          value: nosniff
        x-frame-options:
        - key: X-Frame-Options
          value: DENY
        x-xss-protection:
        - key: X-XSS-Protection
          value: 1; mode=block
      status: '200'
      statusDescription: OK