{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/LoadBalancerArn"
 ],
 "definitions": {
  "Action": {
   "additionalProperties": false,
   "properties": {
    "AuthenticateCognitoConfig": {
     "$ref": "#/definitions/AuthenticateCognitoConfig"
    },
    "AuthenticateOidcConfig": {
     "$ref": "#/definitions/AuthenticateOidcConfig"
    },
    "FixedResponseConfig": {
     "$ref": "#/definitions/FixedResponseConfig"
    },
    "ForwardConfig": {
     "$ref": "#/definitions/ForwardConfig"
    },
    "JwtValidationConfig": {
     "$ref": "#/definitions/JwtValidationConfig"
    },
    "Order": {
     "maximum": 50000,
     "minimum": 1,
     "type": "integer"
    },
    "RedirectConfig": {
     "$ref": "#/definitions/RedirectConfig"
    },
    "TargetGroupArn": {
     "type": "string"
    },
    "Type": {
     "enum": [
      "authenticate-cognito",
      "authenticate-oidc",
      "fixed-response",
      "forward",
      "jwt-validation",
      "redirect"
     ],
     "type": "string"
    }
   },
   "required": [
    "Type"
   ],
   "type": "object"
  },
  "AuthenticateCognitoConfig": {
   "additionalProperties": false,
   "properties": {
    "AuthenticationRequestExtraParams": {
     "patternProperties": {
      "[a-zA-Z0-9]+": {
       "type": "string"
      }
     },
     "type": "object"
    },
    "OnUnauthenticatedRequest": {
     "enum": [
      "allow",
      "authenticate",
      "deny"
     ],
     "type": "string"
    },
    "Scope": {
     "type": "string"
    },
    "SessionCookieName": {
     "type": "string"
    },
    "SessionTimeout": {
     "type": "string"
    },
    "UserPoolArn": {
     "type": "string"
    },
    "UserPoolClientId": {
     "anyOf": [
      {
       "relationshipRef": {
        "propertyPath": "/properties/UserPoolId",
        "typeName": "AWS::Cognito::UserPoolClient"
       }
      },
      {
       "relationshipRef": {
        "propertyPath": "/properties/ClientId",
        "typeName": "AWS::Cognito::UserPoolClient"
       }
      }
     ],
     "type": "string"
    },
    "UserPoolDomain": {
     "type": "string"
    }
   },
   "required": [
    "UserPoolClientId",
    "UserPoolDomain",
    "UserPoolArn"
   ],
   "type": "object"
  },
  "AuthenticateOidcConfig": {
   "additionalProperties": false,
   "anyOf": [
    {
     "required": [
      "ClientSecret"
     ]
    },
    {
     "required": [
      "UseExistingClientSecret"
     ]
    }
   ],
   "properties": {
    "AuthenticationRequestExtraParams": {
     "patternProperties": {
      "[a-zA-Z0-9]+": {
       "type": "string"
      }
     },
     "type": "object"
    },
    "AuthorizationEndpoint": {
     "type": "string"
    },
    "ClientId": {
     "type": "string"
    },
    "ClientSecret": {
     "type": "string"
    },
    "Issuer": {
     "type": "string"
    },
    "OnUnauthenticatedRequest": {
     "enum": [
      "allow",
      "authenticate",
      "deny"
     ],
     "type": "string"
    },
    "Scope": {
     "type": "string"
    },
    "SessionCookieName": {
     "type": "string"
    },
    "SessionTimeout": {
     "type": "string"
    },
    "TokenEndpoint": {
     "type": "string"
    },
    "UseExistingClientSecret": {
     "type": "boolean"
    },
    "UserInfoEndpoint": {
     "type": "string"
    }
   },
   "required": [
    "TokenEndpoint",
    "Issuer",
    "UserInfoEndpoint",
    "ClientId",
    "AuthorizationEndpoint"
   ],
   "type": "object"
  },
  "Certificate": {
   "additionalProperties": false,
   "properties": {
    "CertificateArn": {
     "anyOf": [
      {
       "relationshipRef": {
        "propertyPath": "/properties/Id",
        "typeName": "AWS::CertificateManager::Certificate"
       }
      },
      {
       "relationshipRef": {
        "propertyPath": "/properties/Arn",
        "typeName": "AWS::IAM::ServerCertificate"
       }
      }
     ],
     "format": "AWS::ACM::Certificate.Arn",
     "type": "string"
    }
   },
   "type": "object"
  },
  "FixedResponseConfig": {
   "additionalProperties": false,
   "properties": {
    "ContentType": {
     "maxLength": 32,
     "minLength": 0,
     "type": "string"
    },
    "MessageBody": {
     "maxLength": 1024,
     "minLength": 0,
     "type": "string"
    },
    "StatusCode": {
     "pattern": "^(2|4|5)\\d\\d$",
     "type": "string"
    }
   },
   "required": [
    "StatusCode"
   ],
   "type": "object"
  },
  "ForwardConfig": {
   "additionalProperties": false,
   "properties": {
    "TargetGroupStickinessConfig": {
     "$ref": "#/definitions/TargetGroupStickinessConfig"
    },
    "TargetGroups": {
     "items": {
      "$ref": "#/definitions/TargetGroupTuple"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "type": "object"
  },
  "JwtValidationActionAdditionalClaim": {
   "additionalProperties": false,
   "properties": {
    "Format": {
     "enum": [
      "single-string",
      "space-separated-values",
      "string-array"
     ],
     "type": "string"
    },
    "Name": {
     "type": "string"
    },
    "Values": {
     "items": {
      "type": "string"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "Format",
    "Name",
    "Values"
   ],
   "type": "object"
  },
  "JwtValidationConfig": {
   "additionalProperties": false,
   "properties": {
    "AdditionalClaims": {
     "items": {
      "$ref": "#/definitions/JwtValidationActionAdditionalClaim"
     },
     "type": "array",
     "uniqueItems": true
    },
    "Issuer": {
     "type": "string"
    },
    "JwksEndpoint": {
     "type": "string"
    }
   },
   "required": [
    "JwksEndpoint",
    "Issuer"
   ],
   "type": "object"
  },
  "ListenerAttribute": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "MutualAuthentication": {
   "additionalProperties": false,
   "properties": {
    "AdvertiseTrustStoreCaNames": {
     "enum": [
      "off",
      "on"
     ],
     "type": "string"
    },
    "IgnoreClientCertificateExpiry": {
     "type": "boolean"
    },
    "Mode": {
     "type": "string"
    },
    "TrustStoreArn": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "RedirectConfig": {
   "additionalProperties": false,
   "properties": {
    "Host": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Path": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Port": {
     "type": "string"
    },
    "Protocol": {
     "pattern": "^(HTTPS?|#\\{protocol\\})$",
     "type": "string"
    },
    "Query": {
     "maxLength": 128,
     "minLength": 0,
     "type": "string"
    },
    "StatusCode": {
     "enum": [
      "HTTP_301",
      "HTTP_302"
     ],
     "type": "string"
    }
   },
   "required": [
    "StatusCode"
   ],
   "type": "object"
  },
  "TargetGroupStickinessConfig": {
   "additionalProperties": false,
   "properties": {
    "DurationSeconds": {
     "type": "integer"
    },
    "Enabled": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "TargetGroupTuple": {
   "additionalProperties": false,
   "properties": {
    "TargetGroupArn": {
     "type": "string"
    },
    "Weight": {
     "type": "integer"
    }
   },
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/ListenerArn"
 ],
 "properties": {
  "AlpnPolicy": {
   "items": {
    "type": "string"
   },
   "type": "array"
  },
  "Certificates": {
   "items": {
    "$ref": "#/definitions/Certificate"
   },
   "type": "array",
   "uniqueItems": true
  },
  "DefaultActions": {
   "items": {
    "$ref": "#/definitions/Action"
   },
   "type": "array",
   "uniqueItems": true
  },
  "ListenerArn": {
   "type": "string"
  },
  "ListenerAttributes": {
   "arrayType": "AttributeList",
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ListenerAttribute"
   },
   "type": "array",
   "uniqueItems": true
  },
  "LoadBalancerArn": {
   "type": "string"
  },
  "MutualAuthentication": {
   "$ref": "#/definitions/MutualAuthentication"
  },
  "Port": {
   "maximum": 65535,
   "minimum": 1,
   "type": "integer"
  },
  "Protocol": {
   "enum": [
    "GENEVE",
    "HTTP",
    "HTTPS",
    "QUIC",
    "TCP",
    "TCP_QUIC",
    "TCP_UDP",
    "TLS",
    "UDP"
   ],
   "type": "string"
  },
  "SslPolicy": {
   "type": "string"
  }
 },
 "readOnlyProperties": [
  "/properties/ListenerArn"
 ],
 "required": [
  "LoadBalancerArn",
  "DefaultActions"
 ],
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-elasticloadbalancingv2.git",
 "tagging": {
  "cloudFormationSystemTags": false,
  "tagOnCreate": false,
  "tagUpdatable": false,
  "taggable": false
 },
 "typeName": "AWS::ElasticLoadBalancingV2::Listener",
 "writeOnlyProperties": [
  "/properties/DefaultActions/*/AuthenticateOidcConfig/ClientSecret"
 ]
}
