{
    "version": "1.1",
    "parameters": {
        "Region": {
            "builtIn": "AWS::Region",
            "required": false,
            "documentation": "The AWS region used to dispatch the request.",
            "type": "string"
        },
        "UseDualStack": {
            "builtIn": "AWS::UseDualStack",
            "required": true,
            "default": false,
            "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
            "type": "boolean"
        },
        "UseFIPS": {
            "builtIn": "AWS::UseFIPS",
            "required": true,
            "default": false,
            "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
            "type": "boolean"
        },
        "Endpoint": {
            "builtIn": "SDK::Endpoint",
            "required": false,
            "documentation": "Override the endpoint used to send this request",
            "type": "string"
        },
        "EndpointId": {
            "required": false,
            "documentation": "Operation parameter for EndpointId",
            "type": "string"
        }
    },
    "conditions": [
        {
            "fn": "isSet",
            "argv": [
                {
                    "ref": "Region"
                }
            ]
        },
        {
            "fn": "isSet",
            "argv": [
                {
                    "ref": "Endpoint"
                }
            ]
        },
        {
            "fn": "isSet",
            "argv": [
                {
                    "ref": "EndpointId"
                }
            ]
        },
        {
            "fn": "aws.partition",
            "argv": [
                {
                    "ref": "Region"
                }
            ],
            "assign": "PartitionResult"
        },
        {
            "fn": "booleanEquals",
            "argv": [
                {
                    "ref": "UseFIPS"
                },
                true
            ]
        },
        {
            "fn": "booleanEquals",
            "argv": [
                {
                    "ref": "UseDualStack"
                },
                true
            ]
        },
        {
            "fn": "stringEquals",
            "argv": [
                {
                    "fn": "getAttr",
                    "argv": [
                        {
                            "ref": "PartitionResult"
                        },
                        "name"
                    ]
                },
                "aws-us-gov"
            ]
        },
        {
            "fn": "isValidHostLabel",
            "argv": [
                {
                    "ref": "EndpointId"
                },
                true
            ]
        },
        {
            "fn": "booleanEquals",
            "argv": [
                {
                    "fn": "getAttr",
                    "argv": [
                        {
                            "ref": "PartitionResult"
                        },
                        "supportsFIPS"
                    ]
                },
                true
            ]
        },
        {
            "fn": "booleanEquals",
            "argv": [
                {
                    "fn": "getAttr",
                    "argv": [
                        {
                            "ref": "PartitionResult"
                        },
                        "supportsDualStack"
                    ]
                },
                true
            ]
        },
        {
            "fn": "stringEquals",
            "argv": [
                {
                    "ref": "Region"
                },
                "us-gov-east-1"
            ]
        },
        {
            "fn": "stringEquals",
            "argv": [
                {
                    "ref": "Region"
                },
                "us-gov-west-1"
            ]
        }
    ],
    "results": [
        {
            "conditions": [],
            "endpoint": {
                "url": "https://events.{Region}.{PartitionResult#dualStackDnsSuffix}",
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": {
                    "ref": "Endpoint"
                },
                "properties": {
                    "authSchemes": [
                        {
                            "name": "sigv4a",
                            "signingName": "events",
                            "signingRegionSet": [
                                "*"
                            ]
                        }
                    ]
                },
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://{EndpointId}.endpoint.events.{PartitionResult#dualStackDnsSuffix}",
                "properties": {
                    "authSchemes": [
                        {
                            "name": "sigv4a",
                            "signingName": "events",
                            "signingRegionSet": [
                                "*"
                            ]
                        }
                    ]
                },
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "error": "DualStack is enabled but this partition does not support DualStack",
            "type": "error"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://{EndpointId}.endpoint.events.{PartitionResult#dnsSuffix}",
                "properties": {
                    "authSchemes": [
                        {
                            "name": "sigv4a",
                            "signingName": "events",
                            "signingRegionSet": [
                                "*"
                            ]
                        }
                    ]
                },
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "error": "Invalid Configuration: FIPS is not supported with EventBridge multi-region endpoints.",
            "type": "error"
        },
        {
            "conditions": [],
            "error": "EndpointId must be a valid host label.",
            "type": "error"
        },
        {
            "conditions": [],
            "error": "Invalid Configuration: FIPS and custom endpoint are not supported",
            "type": "error"
        },
        {
            "conditions": [],
            "error": "Invalid Configuration: Dualstack and custom endpoint are not supported",
            "type": "error"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": {
                    "ref": "Endpoint"
                },
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://events-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "error": "FIPS and DualStack are enabled, but this partition does not support one or both",
            "type": "error"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://events.us-gov-east-1.amazonaws.com",
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://events.us-gov-west-1.amazonaws.com",
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://events-fips.{Region}.{PartitionResult#dnsSuffix}",
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "error": "FIPS is enabled but this partition does not support FIPS",
            "type": "error"
        },
        {
            "conditions": [],
            "endpoint": {
                "url": "https://events.{Region}.{PartitionResult#dnsSuffix}",
                "properties": {},
                "headers": {}
            },
            "type": "endpoint"
        },
        {
            "conditions": [],
            "error": "Invalid Configuration: Missing Region",
            "type": "error"
        }
    ],
    "root": 2,
    "nodeCount": 31,
    "nodes": "/////wAAAAH/////AAAAAAAAAAQAAAADAAAAAQAAABsF9eESAAAAAQAAABkAAAAFAAAAAgAAABEAAAAGAAAAAwAAAAcF9eESAAAABAAAAAoAAAAIAAAABQAAAAkF9eERAAAACQX14QEF9eEEAAAABQAAAA4AAAALAAAACAAAAAwF9eEQAAAACgX14Q0AAAANAAAACwX14Q4F9eEPAAAABgX14QEAAAAPAAAACAAAABAF9eEMAAAACQX14QsF9eEMAAAAAwAAABIF9eESAAAABAAAABcAAAATAAAABQAAABUAAAAUAAAABwX14QUF9eEHAAAABwAAABYF9eEHAAAACQX14QMF9eEEAAAABQAAABgAAAAfAAAABgX14QEAAAAfAAAAAgAAABoAAAAbAAAAAwAAAB0AAAAbAAAABAX14QgAAAAcAAAABQX14QkF9eEKAAAABAAAAB8AAAAeAAAABwX14QIF9eEHAAAABwX14QYF9eEH"
}