gpt4 book ai didi

amazon-web-services - Cloudformation模板验证

转载 作者:行者123 更新时间:2023-12-04 14:12:18 25 4
gpt4 key购买 nike

根据aws validate-template ,我进行了测试以验证 URL 和本地文件中的相同模板。

但我得到了不同的输出。

直接从 URL 测试:

$ aws cloudformation validate-template --template-url https://s3.amazonaws.com/cloudformation-templates-us-east-1/S3_Bucket.template
{
"Description": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a publicly accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters": []
}

但是当我将其下载到本地并再次测试时。

$ wget https://s3.amazonaws.com/cloudformation-templates-us-east-1/S3_Bucket.template

2014-12-16 14:48:27 (11.1 MB/s) - 'S3_Bucket.template' saved [652/652]

$ aws cloudformation validate-template --template-body S3_Bucket.template

A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template format error: JSON not well-formed. (line 1, column 10)

有什么想法吗?

最佳答案

我现在知道如何解决它了。您需要使用 file:/// 提供文件完整路径

aws cloudformation validate-template --template-body file:///home/local/test/S3_Bucket.template

或者使用相对路径( file://而不是 file:///):

aws cloudformation validate-template --template-body file://S3_Bucket.template

关于amazon-web-services - Cloudformation模板验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27497270/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com