1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Terraformで警告エラー「Warning: Quoted type constraints are deprecated」

1
Last updated at Posted at 2020-01-11

https___qiita-image-store.s3.ap-northeast-1.amazonaws.com_0_321850_853d8fc1-22f8-159f-0191-0271e18659ee.jpeg

概要

以下の記事を参考にTerraformでIAMユーザ作っていたら警告エラーが出たのでメモ

TerraformでIAMグループ・ユーザを作成する
https://qiita.com/digitalpeak/items/427f6cf7ed14f4187cd2

事象

Terraformでplanを実行したら以下のような警告エラーが出た

Warning: Quoted type constraints are deprecated

  on variables.tf line 2, in variable "aws_iam_user":
   2:   type = "list"

Terraform 0.11 and earlier required type constraints to be given in quotes,
but that form is now deprecated and will be removed in a future version of
Terraform. To silence this warning, remove the quotes around "list" and write
list(string) instead to explicitly indicate that the list elements are
strings.

よくわからないのでGoogle翻訳にぶち込んでみる

警告:引用符付きの型制約は、変数 "aws_iam_user"のvariables.tf行2で非推奨になりました。
現在、フォームは非推奨であり、Terraformの将来のバージョンで削除されます。

この警告を黙らせるには、「リスト」を囲む引用符を削除し、代わりにリスト(文字列)を記述して、リスト要素が文字列であることを明示的に示します。

書き方が古いらしい。。。

解消方法

「type = “list”」を「type = list(string)」にすることで解消した。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?