{
  "typeName" : "AWS::ApiGateway::ApiKey",
  "description" : "The ``AWS::ApiGateway::ApiKey`` resource creates a unique key that you can distribute to clients who are executing API Gateway ``Method`` resources that require an API key. To specify which API key clients must use, map the API key with the ``RestApi`` and ``Stage`` resources that include the methods that require a key.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-apigateway",
  "additionalProperties" : false,
  "properties" : {
    "APIKeyId" : {
      "description" : "",
      "type" : "string"
    },
    "CustomerId" : {
      "description" : "",
      "type" : "string"
    },
    "Description" : {
      "description" : "",
      "type" : "string"
    },
    "Enabled" : {
      "description" : "",
      "default" : false,
      "type" : "boolean"
    },
    "GenerateDistinctId" : {
      "description" : "",
      "type" : "boolean"
    },
    "Name" : {
      "description" : "A name for the API key. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the API key name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html).\n  If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.",
      "type" : "string"
    },
    "StageKeys" : {
      "description" : "",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/StageKey"
      }
    },
    "Tags" : {
      "description" : "",
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Value" : {
      "description" : "",
      "type" : "string"
    }
  },
  "definitions" : {
    "StageKey" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RestApiId" : {
          "description" : "",
          "type" : "string"
        },
        "StageName" : {
          "description" : "",
          "type" : "string"
        }
      },
      "description" : "``StageKey`` is a property of the [AWS::ApiGateway::ApiKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html) resource that specifies the stage to associate with the API key. This association allows only clients with the key to make requests to methods in that stage."
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "description" : "A string you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "The value for the specified tag key.",
          "type" : "string",
          "maxLength" : 256
        }
      },
      "required" : [ "Value", "Key" ],
      "description" : "An array of key-value pairs to apply to this resource.\n For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)."
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "apigateway:PUT", "apigateway:DELETE", "apigateway:GET" ]
  },
  "createOnlyProperties" : [ "/properties/GenerateDistinctId", "/properties/Name", "/properties/Value" ],
  "writeOnlyProperties" : [ "/properties/GenerateDistinctId" ],
  "primaryIdentifier" : [ "/properties/APIKeyId" ],
  "readOnlyProperties" : [ "/properties/APIKeyId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "apigateway:POST", "apigateway:GET", "apigateway:PUT" ]
    },
    "read" : {
      "permissions" : [ "apigateway:GET" ]
    },
    "update" : {
      "permissions" : [ "apigateway:GET", "apigateway:PATCH", "apigateway:PUT", "apigateway:DELETE" ]
    },
    "delete" : {
      "permissions" : [ "apigateway:DELETE", "apigateway:GET" ]
    },
    "list" : {
      "permissions" : [ "apigateway:GET" ]
    }
  }
}