Error: Reference to undeclared resource
Jump to navigation
Jump to search
terraform plan ╷ │ Error: Reference to undeclared resource │ │ on main.tf line 9, in resource "aws_instance" "example": │ 9: ami = data.aws_ami.windows.id │ │ A data resource "aws_ami" "windows" has not been declared in the root module.
╷ │ Error: Reference to undeclared resource │ │ on main.tf line 14, in resource "aws_db_instance" "my_mariadb_instance": │ 14: db_subnet_group_name = vpc.subnet-0526dd2XXXXXX │ │ A managed resource "vpc" "subnet-0526dd2e6fce5492b" has not been declared in the root module. ╵
╷ │ Error: Reference to undeclared resource │ │ on main.tf line 16, in resource "aws_db_instance" "my_mariadb_instance": │ 16: db_subnet_group_name = "${aws_db_subnet_group.default.id}" │ │ A managed resource "aws_db_subnet_group" "default" has not been declared in the root module. ╵
╷ │ Error: Reference to undeclared resource │ │ on main.tf line 42, in resource "aws_security_group" "allow_ssh": │ 42: vpc_id = aws_vpc.main.id │ │ A managed resource "aws_vpc" "default" has not been declared in the root module. ╵
Related[edit]
- Terraform plan execution with errors:
Error: Reference to undeclared module
Error: Unsupported attribute
terraform import
tolist
See also[edit]
Advertising: