【发布时间】:2019-09-04 22:31:18
【问题描述】:
我正在尝试运行 Cloudformation 模板来创建私有 API 网关,我收到空值错误,无法弄清楚原因,
以下是我正在尝试使用的模板-
AWSTemplateFormatVersion: 2010-09-09
Transform: 'AWS::Serverless-2016-10-31'
Description: Api Template Stack
Parameters:
VpcId:
Type: String
Default: "vpc-xxxxxx"
Resources:
PrivateGateway:
Type: 'AWS::ApiGateway::RestApi'
Properties:
Name: 'private-gw'
EndpointConfiguration:
Types:
- PRIVATE
Policy: !Sub |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:us-east-1:${AWS::AccountId}:*/*/*/*",
"Condition": {
"StringNotEquals": {
"aws:sourceVpc": !Ref VpcId
}
}
},
{
"Effect": "Allow",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:us-east-1:${AWS::AccountId}:*/*/*/*"
}
]
}
错误 -
[/Resources/PrivateGateway/Properties] 'null' values are not allowed in templates
【问题讨论】:
标签: amazon-web-services amazon-cloudformation