{
  "typeName" : "AWS::Lambda::Alias",
  "description" : "Resource Type definition for AWS::Lambda::Alias",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-lambda",
  "definitions" : {
    "ProvisionedConcurrencyConfiguration" : {
      "type" : "object",
      "description" : "A provisioned concurrency configuration for a function's alias.",
      "additionalProperties" : false,
      "properties" : {
        "ProvisionedConcurrentExecutions" : {
          "type" : "integer",
          "description" : "The amount of provisioned concurrency to allocate for the alias."
        }
      },
      "required" : [ "ProvisionedConcurrentExecutions" ]
    },
    "VersionWeight" : {
      "type" : "object",
      "description" : "The traffic-shifting configuration of a Lambda function alias.",
      "additionalProperties" : false,
      "properties" : {
        "FunctionWeight" : {
          "type" : "number",
          "description" : "The percentage of traffic that the alias routes to the second version."
        },
        "FunctionVersion" : {
          "type" : "string",
          "description" : "The qualifier of the second version."
        }
      },
      "required" : [ "FunctionVersion", "FunctionWeight" ]
    },
    "AliasRoutingConfiguration" : {
      "type" : "object",
      "description" : "The traffic-shifting configuration of a Lambda function alias.",
      "additionalProperties" : false,
      "properties" : {
        "AdditionalVersionWeights" : {
          "type" : "array",
          "description" : "The second version, and the percentage of traffic that's routed to it.",
          "uniqueItems" : true,
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/VersionWeight"
          }
        }
      }
    }
  },
  "properties" : {
    "FunctionName" : {
      "description" : "The name of the Lambda function.",
      "type" : "string"
    },
    "AliasArn" : {
      "description" : "Lambda Alias ARN generated by the service.",
      "type" : "string"
    },
    "ProvisionedConcurrencyConfig" : {
      "description" : "Specifies a provisioned concurrency configuration for a function's alias.",
      "$ref" : "#/definitions/ProvisionedConcurrencyConfiguration"
    },
    "Description" : {
      "description" : "A description of the alias.",
      "type" : "string"
    },
    "FunctionVersion" : {
      "description" : "The function version that the alias invokes.",
      "type" : "string"
    },
    "RoutingConfig" : {
      "description" : "The routing configuration of the alias.",
      "$ref" : "#/definitions/AliasRoutingConfiguration"
    },
    "Name" : {
      "description" : "The name of the alias.",
      "type" : "string"
    }
  },
  "tagging" : {
    "taggable" : false
  },
  "additionalProperties" : false,
  "required" : [ "FunctionName", "FunctionVersion", "Name" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/FunctionName" ],
  "primaryIdentifier" : [ "/properties/AliasArn" ],
  "readOnlyProperties" : [ "/properties/AliasArn" ],
  "propertyTransform" : {
    "/properties/FunctionName" : "$split(FunctionName, \":\")[-1] $OR FunctionName $OR $join([\"((arn:.*:lambda:.*:[0-9]{12}:function)|([0-9]{12}:function)):\", $split(FunctionName, \":\")[-1]])"
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "lambda:CreateAlias", "lambda:PutProvisionedConcurrencyConfig", "lambda:GetProvisionedConcurrencyConfig" ],
      "timeoutInMinutes" : 45
    },
    "read" : {
      "permissions" : [ "lambda:GetAlias", "lambda:GetProvisionedConcurrencyConfig" ]
    },
    "delete" : {
      "permissions" : [ "lambda:DeleteAlias", "lambda:GetAlias" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "FunctionName" : {
            "$ref" : "resource-schema.json#/properties/FunctionName"
          }
        },
        "required" : [ "FunctionName" ]
      },
      "permissions" : [ "lambda:ListAliases" ]
    },
    "update" : {
      "permissions" : [ "lambda:UpdateAlias", "lambda:GetAlias", "lambda:PutProvisionedConcurrencyConfig", "lambda:DeleteProvisionedConcurrencyConfig", "lambda:GetProvisionedConcurrencyConfig", "codedeploy:CreateDeployment", "codedeploy:GetDeployment", "codedeploy:GetDeploymentGroup", "codedeploy:GetDeploymentConfig", "codedeploy:StopDeployment" ],
      "timeoutInMinutes" : 120
    }
  }
}