概要
以下の記事を参考に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)」にすることで解消した。
