{
    "Type": "Custom::APIGateway",
    "Properties": {
        "ServiceToken": {
            "Fn::Join": [
                ":",
                [
                    "arn:aws:lambda",
                    {
                        "Ref": "AWS::Region"
                    },
                    {
                        "Ref": "AWS::AccountId"
                    },
                    "function:{{=it.lambda.name}}:{{=it.lambda.alias}}"
                ]
            ]
        },
        "Definition": {
            "S3Bucket": "{{=it.s3.bucket}}",
            "S3Key": "{{=it.s3.key}}"
        },
        "StageName": "{{=it.stageName}}",
        "Variables": {
            {{~it.variables :value:idx}}
                "{{=value.key}}": {
                    "Fn::GetAtt": [
                        "{{=value.value}}",
                        "Arn"
                    ]
                }{{? idx < it.variables.length - 1}},{{?}}
            {{~}}
        }
    }
}
