amazon-web-services - Cloudformation属性验证失败: Encountered unsupported properties

标签 amazon-web-services aws-cloudformation amazon-cognito

我正在尝试创建一个嵌套堆栈,其根堆栈如下所示:

{
    "AWSTemplateFormatVersion": "2010-09-09",

    "Resources": {
        "DynamoDBTable": {
            "Type": "AWS::CloudFormation::Stack",
            "Properties": {
                "Parameters": {
                    "TableName": {
                        "Fn::Sub": "${AWS::StackName}"
                    }
                },
                "TemplateURL": "https://s3.amazonaws.com/my-templates-bucket/dynamodb.json"
            }
        },
        "S3WebsiteReact": {
            "Type": "AWS::CloudFormation::Stack",
            "Properties": {
                "Parameters": {
                    "BucketName": {
                        "Fn::Sub": "${AWS::StackName}-website"
                    }
                },
                "TemplateURL": "https://s3.amazonaws.com/my-templates-bucket/s3-static-website-react.json"
            }
        },
        "S3UploadBucket": {
            "Type": "AWS::CloudFormation::Stack",
            "Properties": {
                "Parameters": {
                    "BucketName": {
                        "Fn::Sub": "${AWS::StackName}-upload"
                    }
                },
                "TemplateURL": "https://s3.amazonaws.com/my-templates-bucket/s3-with-cors.json"
            }
        },
        "Cognito": {
            "Type": "AWS::CloudFormation::Stack",
            "DependsOn": "DynamoDBTable",
            "Properties": {
                "Parameters": {
                    "CognitoUserPoolName": {
                        "Fn::Join" : ["",
                            {
                                "Fn::Split": ["-", {
                                    "Ref": "AWS::StackName"
                                }]
                            }
                        ]
                    }
                },
                "TemplateURL": "https://s3.amazonaws.com/my-templates-bucket/cognito.json"
            }
        },
        "ApiGateway": {
            "Type": "AWS::CloudFormation::Stack",
            "DependsOn": ["DynamoDBTable", "Cognito"],
            "Properties": {
                "Parameters": {
                    "ApiGatewayName": {
                        "Fn::Sub": "${AWS::StackName}-api"
                    },
                    "CognitoUserPoolArn": {
                        "Fn::GetAtt": [ "Cognito", "Outputs.UserPoolArn" ]
                    },
                    "DynamoDBStack": {
                        "Fn::GetAtt": [ "DynamoDBTable", "Outputs.DDBStackName" ]
                    }
                },
                "TemplateURL": "https://s3.amazonaws.com/my-templates-bucket/api-gateway.json"
            }
        },
        "IdentityPool": {
            "Description": "Cognito Identity Pool. Must be created after User Pool and API Gateway.",
            "Type": "AWS::Cognito::IdentityPool",
            "DependsOn": ["Cognito", "ApiGateway", "S3UploadBucket"],
            "Properties": {
                "Parameters": {
                    "AppClientId": {
                        "Fn::GetAtt": [ "Cognito", "Outputs.AppClientId" ]
                    },
                    "UserPoolProviderName": {
                        "Fn::GetAtt": [ "Cognito", "Outputs.ProviderName" ]
                    },
                    "UserPoolName": {
                        "Fn::GetAtt": [ "Cognito", "Outputs.UserPoolName" ]
                    },
                    "UploadBucketName": {
                        "Fn::GetAtt": [ "S3UploadBucket", "Outputs.UploadBucketName" ]
                    },
                    "ApiGatewayId": {
                        "Fn::GetAtt": [ "ApiGateway", "Outputs.ApiGatewayId" ]
                    }
                },
                "TemplateURL": "https://s3.amazonaws.com/my-templates-bucket/identity-pool.json"
            }
        }
    },

    "Outputs": {

    }
}

我收到此错误:

2019-06-19 14:45:14 UTC-0400    IdentityPool    CREATE_FAILED   Property validation failure: [Encountered unsupported properties in {/}: [TemplateURL, Parameters]]

我的身份池堆栈似乎存在一些参数问题。但身份池堆栈参数如下所示:

"Parameters" : {
        "AppClientId": {
            "Description": "ID of the App Client of the Cognito User Pool passed into this stack.",
            "Type": "String"
        },
        "UserPoolProviderName": {
            "Description": "Cognito User Pool Provider name passed into this stack.",
            "Type": "String"
        },
        "UserPoolName": {
            "Description": "Cognito User Pool Name passed into this stack.",
            "Type": "String"
        },
        "UploadBucketName": {
            "Description": "Name of the bucket that is used to upload files to.",
            "Type": "String"
        },
        "ApiGatewayId": {
            "Description": "ID of the API Gateway created for the stack.",
            "Type": "String"
        }
    },

有趣的是:我尝试单独创建每个堆栈,然后将它们的输出作为参数传递给需要这些参数的堆栈,并且每个堆栈都成功创建,没有任何问题。

我尝试查找不支持的内容,但找不到任何答案。

最佳答案

错误:

[Encountered unsupported properties in {/}: [TemplateURL, Parameters]]

表示不支持这两个属性。与模板中声明的所有其他资源也使用这两个属性不同,此资源是 AWS::Cognito::IdentityPool,而其余资源都是 AWS::类型CloudFormation::Stack

这两个属性仅在 AWS::CloudFormation::Stack 类型上有效,因此会出现验证错误。

关于amazon-web-services - Cloudformation属性验证失败: Encountered unsupported properties,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56674837/

相关文章:

amazon-web-services - 如何通过 CloudFormation 设置 AWS 对等连接 DNS 解析选项?

amazon-web-services - 云信息模板错误

amazon-cognito - 如何仅使用 auth 包配置 Amplify?

image - AWS API Gateway 从 base64 浏览器错误返回二进制文件

amazon-web-services - 亚马逊 EC2 Laravel 应用程序无法正常工作

amazon-web-services - 如何找到谁创建了 AWS RDS 数据库实例?

javascript - AWS 认知 : getting "Please provide a valid public provider" with google

amazon-web-services - AWS Firehose 换行符

amazon-web-services - AWS Cloudformation 模板 EC2 角色/策略循环依赖

Android Amazon AWS Cognito 工作流程确认