imohd23 / Terraws-script

This repo made to support this article, New Documentation is coming
MIT License
3 stars 18 forks source link

ERROR: Unsupported attribute - This object does not have an attribute named "this_security_group_id". #3

Open calidude25 opened 2 years ago

calidude25 commented 2 years ago

$ terraform plan ╷ │ Error: Unsupported attribute │ │ on main.tf line 66, in module "efs_sg": │ 66: source_security_group_id = module.instance_sg.this_security_group_id │ ├──────────────── │ │ module.instance_sg is a object, known only after apply │ │ This object does not have an attribute named "this_security_group_id". ╵ ╷ │ Error: Unsupported attribute │ │ on main.tf line 93, in resource "aws_efs_mount_target" "efs_mount": │ 93: security_groups = [module.efs_sg.this_security_group_id] │ ├──────────────── │ │ module.efs_sg is a object, known only after apply │ │ This object does not have an attribute named "this_security_group_id". ╵ ╷ │ Error: Unsupported attribute │ │ on main.tf line 122, in module "auto_scaling": │ 122: security_groups = [module.instance_sg.this_security_group_id] │ ├──────────────── │ │ module.instance_sg is a object, known only after apply │ │ This object does not have an attribute named "this_security_group_id". ╵ ╷ │ Error: Unsupported attribute │ │ on main.tf line 162, in module "elb_http": │ 162: security_groups = [module.instance_sg.this_security_group_id] │ ├──────────────── │ │ module.instance_sg is a object, known only after apply │ │ This object does not have an attribute named "this_security_group_id".

calidude25 commented 2 years ago

Additional updated version details -

$ terraform init Initializing modules...

Initializing the backend...

Initializing provider plugins...

Terraform has created a lock file .terraform.lock.hcl to record the provider selections it made above. Include this file in your version control repository so that Terraform can guarantee to make the same selections by default when you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work.

If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.

calidude25 commented 2 years ago

updated to remove "this" from the call -

this_security_group_id

works as

security_group_id

imohd23 commented 2 years ago

I guess the library got updated, will rerun it again and add more meaningful documentation.