【问题标题】:terraform import AWS s3 bucket with dot in nameterraform 导入名称为点的 AWS s3 存储桶
【发布时间】:2022-01-14 17:36:22
【问题描述】:

我正在尝试使用以下命令将存储桶导入名称中带有点的 tfstate:

terraform 导入 aws_s3_bucket.example.com example.com

存储桶名称为 example.com 我的资源是这样构建的

资源“aws_s3_bucket”“example.com”{ }

关于导入,我收到此错误:地址后出现意外的额外运算符。 并试图用 \ 逃避它,但没有奏效。 至于资源我怎么能逃脱它?因为我告诉我名字应该只有数字破折号和连字符......

【问题讨论】:

  • 资源名称不必与实际存储桶名称匹配。存储桶名称在资源中以字符串形式提供,键为 bucket.
  • 进展如何?仍然不清楚为什么它不起作用?

标签: amazon-web-services terraform terraform-provider-aws terraform0.12+


【解决方案1】:

example.com 是一个无效名称。 TF 中的资源名称中不能包含 .。您只能使用:

字母、数字、下划线和破折号

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-06
    • 2020-07-16
    • 1970-01-01
    • 2021-01-27
    相关资源
    最近更新 更多