Difference between revisions of "Error: Reference to undeclared resource"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by one other user not shown)
Line 39: Line 39:
  
 
== Related  ==
 
== Related  ==
* [[Terraform plan execution with errors]]: [[Error: Reference to undeclared module]]
+
* [[Terraform plan execution with errors]]: <code>[[Error: Reference to undeclared module]]</code>
 
* <code>[[Error: Unsupported attribute]]</code>
 
* <code>[[Error: Unsupported attribute]]</code>
 +
* <code>[[terraform import]]</code>
 +
* <code>[[tolist]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 11:27, 27 February 2023

 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]

See also[edit]

Advertising: