我有兩個在不同時間部署的 Terraform 專案。其中一個需要參考另一個專案中的 API Gateway 使用計劃,應該先部署。代碼如下所示:
data "aws_api_gateway_usage_plan" "usage_plan" {
name = "name-of-usage-plan"
}
但是,當我執行時terraform plan,我得到以下資訊:
data "aws_api_gateway_usage_plan" "usage_plan" {
The provider hashicorp/aws does not support data source "aws_api_gateway_usage_plan".
Did you intend to use the managed resource type "aws_api_gateway_usage_plan"? If so, declare this using a "resource" block instead of a "data" block.
我認為如果我使用“資源”塊,它只會創建一個新的使用計劃,我不想這樣做。
我將 terraform 1.1.0 與 aws 提供程式 v4.6.0 一起使用。
我還有什么其他選擇?我可以使用 AWS CLI 獲取對資源的參考嗎?我只需要獲取其 ARN 即可將其添加到 IAM 陳述句中。
uj5u.com熱心網友回復:
沒有名為 的資料源aws_api_gateway_usage_plan。TF 不支持。請查看檔案以獲取現有資料源的串列。
您必須實作自己的自定義資料源來查詢 API 階段詳細資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/447475.html
標籤:亚马逊网络服务 地形 aws-api-网关 盐酸
上一篇:從Lambda連接雪花的會話
