Skip to main content

Posts

Showing posts from 2022

call to function "map" failed: the "map" function was deprecated in Terrafrom

How to change map method to tomap method? Let's say you have multiple tags in your code which was written quite back and that time it was working fine on old Terraform version before v0.12 but if the same code you execute on updated/latest Terrafrom you get subjected error while try to run Terrafrom plan command. Then this article will help you to fix your issue. What is simple solution to fix this issue? Just replace " map " method to " tomap " and just to little bit formatting for the same. Syntax:- map ({"Name", "My_Name"), map("AppName", "My_App")}) tomap ({"Name"  =   "My_Name",  "App_Name"  =   "My_App"}) or tomap ({     "Name"  =   "My_Name",     "App_Name"  =   "My_App" }) #Code with " map " method resource "aws_instance" "My_instance"   ami   =   my_ami   instance_type =   my_type   tags  =   merge(var.tag...