Amazon web services 模板的Resources块中未解析的资源依赖项[RestAPIDeployment]

Amazon web services 模板的Resources块中未解析的资源依赖项[RestAPIDeployment],amazon-web-services,amazon-cloudformation,aws-api-gateway,Amazon Web Services,Amazon Cloudformation,Aws Api Gateway,Im在模板的资源块中获取错误未解析的资源依赖项[RestAPIDeployment], 在使用cloudformation创建api网关时 请帮忙 模板为: { “AWSTemplateFormatVersion”:“2010-09-09”, “说明”:“创建用于静态内容/网站托管的网关。”, “参数”:{ 您引用的是RestAPIDeployment(大写字母“p”和“I”),但定义的是RestAPIDeployment(小写字母“p”和“I”) 让这些保持一致,你就会克服这个问题 "

Im在模板的资源块中获取错误未解析的资源依赖项[RestAPIDeployment], 在使用cloudformation创建api网关时 请帮忙 模板为:

{ “AWSTemplateFormatVersion”:“2010-09-09”, “说明”:“创建用于静态内容/网站托管的网关。”, “参数”:{


您引用的是RestAPIDeployment(大写字母“p”和“I”),但定义的是RestAPIDeployment(小写字母“p”和“I”)

让这些保持一致,你就会克服这个问题

    "AssetInsightId": {
        "Description": "Asset Insight ID",
        "Type": "String",
        "Default": "206153"
    },
    "ResourceOwner": {
        "Description": "tr:resource-owner",
        "Type": "String",
        "Default": "###"
    },
    "EnvironmentType": {
        "Description": "tr:environment-type",

        "Default": "preprod",
        "Type": "String",
        "AllowedValues": ["preprod", "prod"],
        "ConstraintDescription": "must specify preprod, prod."
    }
},
"Resources": {
    "APIGateWayRestResourceRestApi": {
        "Type": "AWS::ApiGateway::RestApi",
        "Properties": {
            "Name": "MyAPI",
            "Description": "API Gateway rest api with cloud formation"
        }
    },
    "APIGateWayResource": {
        "Type": "AWS::ApiGateway::Resource",
        "Properties": {
            "RestApiId": {
                "Ref": "APIGateWayRestResourceRestApi"
            },
            "ParentId": {
                "Fn::GetAtt": ["APIGateWayRestResourceRestApi", "RootResourceId"]
            },
             "PathPart": "pathpart"
             }

        },
    "APIGatewayPostMethod": {
        "Type": "AWS::ApiGateway::Method",
        "Properties": {
            "AuthorizationType": "NONE",
            "HttpMethod": "POST",

            "Integration": {
                "Type": "MOCK",
                "IntegrationHttpMethod": "POST"

            },
            "MethodResponses": [{
                    "ResponseModels": {
                        "application/json": {
                            "Ref": "PostMethodResponse"
                        }
                    },
                    "statusCode" : 200
                }
            ],

            "ResourceId": {
                "Ref": "APIGateWayResource"
            },

            "RestApiId": {
                "Ref": "APIGateWayRestResourceRestApi"
            }
        }
    },
    "PostMethodResponse": {
        "Type": "AWS::ApiGateway::Model",
        "Properties": {
            "ContentType": "application/json",
            "Name": "PostMethodResponse",
            "RestApiId": {
                "Ref": "APIGateWayRestResourceRestApi"
            },
            "Schema": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "title": "PostMethodResponse",
                "type": "object",
                "properties": {
                    "Email": {
                        "type": "string"
                    }
                }
            }
        }
    },

    "RestApiDeployment": {
        "Type": "AWS::ApiGateway::Deployment",
        "Properties": {
            "RestApiId": {
                "Ref": "APIGateWayRestResourceRestApi"
            },
            "StageName": "dummy"
        }
    },

    "RestAPIStage": {

        "Properties": {
            "DeploymentId": {
                "Ref": "RestAPIDeployment"
            },
            "MethodSettings": [{
                    "DataTraceEnabled": true,
                    "HttpMethod": "*",
                    "LoggingLevel": "INFO",
                    "ResourcePath": "/*"
                }
            ],
            "RestApiId": {
                "Ref": "APIGateWayRestResourceRestApi"
            },
            "StageName": "Latest"
        },
        "Type": "AWS::ApiGateway::Stage"
    }
    }

}