[英]When using Terraform with AWS, how can I set a rate limit on a specific URI path (or regex of a URI path) on an ALB
[英]How I can solve this error when importing aws.alb.TargetGroup using Pulumi Cli
我嘗試將現有資源導入 Pulumi。 我在我的終端上執行以下命令。
$ pulumi import aws:alb/targetGroup:TargetGroup target-group-name target-group-arn
但是我有以下錯誤。
error: internal error: Error: cannot assign expression of type tuple(cty.NullVal(cty.DynamicPseudoType)) to location of type union(list(union(object({onDeregistration = union(output(string), string, annotated(0x14001d12b40)), onUnhealthy = union(output(string), string, annotated(0x14001d12b80))}, annotated(0x14001d12b00)), output(object({onDeregistration = string, onUnhealthy = string}, annotated(0x14001d12bc0))), annotated(0x14001d12c00))), none, output(list(object({onDeregistration = string, onUnhealthy = string}, annotated(0x14001d12bc0)))), annotated(0x14001d12cc0)):
on anonymous.pp line 22:
23: targetFailovers =[
24: null]
我無法解決這個錯誤。 請教我如何解決。 或者請教我如何從 pulumi state 生成 typescript 代碼。因為導入成功了。
附錄 我的環境是:
查看文檔https://www.pulumi.com/docs/guides/adopting/import/ - 命令應如下所示:
pulumi import aws:s3/bucket:Bucket infra-logs company-infra-logs
當infra-logs是您的 Pulumi 程序的資源名稱,而company-infra-logs是存儲桶名稱時。
在您的情況下,當導入目標組時,需要一個 ARN 而不是資源名稱。
我試過像這樣獲取目標組:
pulumi import aws:alb/targetGroup:TargetGroup test-tg <ARN>
它對我有用。
幾個要點供您驗證:
確保正確復制 ARN,ARN 構建如下:
arn:aws:elasticloadbalancing::<ACCOUNT_ID>:targetgroup/<TARGET_GROUP_NAME>/
確保您的 pulumi 堆棧與您的目標群體位於同一區域
確保您的 AWS 憑據配置正確(您可能使用了錯誤的配置文件或錯誤的帳戶)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.