【发布时间】:2018-06-29 06:41:27
【问题描述】:
我有以下 cloudformation 代码:
usagePlan:
Type: AWS::ApiGateway::UsagePlan
Properties:
ApiStages:
- ApiId: !ImportValue: "test-restApi-lambda-send-email-contactus-post"
Stage: "stg1"
Description: Customer ABC's usage plan
Quota:
Limit: 5000
Period: MONTH
Throttle:
BurstLimit: 200
RateLimit: 100
UsagePlanName: Plan_ABC
一切都很好,代码正在运行。 只要我把它转到:
usagePlan:
Type: AWS::ApiGateway::UsagePlan
Properties:
ApiStages:
- ApiId:
Fn::ImportValue: !Sub "${project}-restApi-lambda-send-email-contactus-post"
Stage: "stg1"
Description: Customer ABC's usage plan
Quota:
Limit: 5000
Period: MONTH
Throttle:
BurstLimit: 200
RateLimit: 100
UsagePlanName: Plan_ABC
我收到以下错误:
An error occurred (ValidationError) when calling the CreateStack operation: [/Resources/usagePlan/Type/ApiStages/0/ApiId] 'null' values are not allowed in templates
问题恰好发生在这个阶段:
Fn::ImportValue: !Sub "${project}-restApi-lambda-send-email-contactus-post"
有什么想法吗?这是aws中的错误吗?
【问题讨论】:
标签: amazon-web-services aws-api-gateway amazon-cloudformation