I'm attempting to create an AWS::ApiGateway::RestApi
resource using CloudFormation but when running
aws cloudformation deploy --template-file lorem.json --stack-name lorem
This ends up failing and upon looking in the CloudFormation console I see that the error is Invalid REST API identifier specified
.
Here is my lorem.json
file:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "lorem.io Stack",
"Resources": {
"API": {
"Type" : "AWS::ApiGateway::RestApi",
"Properties" : {
"FailOnWarnings": true,
"BodyS3Location": {
"Bucket": "cloudformation.lorem.io",
"Key": "open-api.json"
}
}
}
}
}
Here I'm specifying BodyS3Location
which points at an S3 object that contains the following:
{
"swagger": "2.0",
"info": {
"title": "Lorem.IO API",
"version": "1.0.0"
},
"definitions": {
"Generator": {
"type": "object",
"properties": {
"title": {
"type": "string"
}
}
}
},
"produces": [
"application/json"
],
"paths": {
"/generators": {
"get": {
"responses": {
"200": {
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Generator"
}
}
}
}
}
}
}
}
Because I'm providing this file according to the documentation I shouldn't have to provide the name of the RestApi so I don't think that's the problem. Any idea on how I would go about debugging exactly what it's unhappy about?
Update #1
I've stripped out a lot of my configuration so that the only property that I'm now specifying is name
and I still get the same error (Invalid REST API identifier specified
):
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "lorem.io Stack",
"Resources": {
"API": {
"Type" : "AWS::ApiGateway::RestApi",
"Properties" : {
"FailOnWarnings": true,
"Name": "Hello World"
}
}
}
}
According to the documentation Name
is the only required attribute - Is this a bug w/ CloudFormation or am I missing something?