"DependsOn": [] 在 cloudformation 中是什么意思

what does "DependsOn": [] means in cloudformation

我正在使用 AWS 提供的模板,该模板在嵌套堆栈调用中使用 "DependsOn": []。 我知道 dependson 可以有一个列表依赖但从来没有遇到过这个。

BucketsStack": {
        "DependsOn": [],
        "Properties": {
            "Parameters": {
                "CreateDemonstration": {
                    "Ref": "CreateDemonstration"
                },

删除它,因为它是一个空数组,所以没有用。

确实DependsOn影响了资源创建的顺序。

以下来自official documentation

With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute.