Difference between revisions of "Error: Reference to undeclared resource"
Jump to navigation
Jump to search
Line 27: | Line 27: | ||
╵ | ╵ | ||
+ | ╷ | ||
+ | │ 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. | ||
+ | ╵ | ||
Revision as of 06:10, 12 September 2022
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
- Terraform plan execution with errors: Error: Reference to undeclared module
- Error: Unsupported attribute
See also
Advertising: