Identifying resources to import
Just as there were subtle differences in each of the cloud architectures we developed in the previous chapters of this book, the way in which existing resources are imported into Terraform is affected by the structural and not-so-subtle differences between the cloud platforms.
AWS
The naming convention used by AWS for EC2 instances tends to look like this: i-abcd1234
. It typically consists of two components: the prefix and the identifier, with the prefix varying across AWS services.
The i-
prefix indicates that this is an Elastic Compute Cloud (EC2) instance. Other prefixes might be used for different types of resources, such as vol-
for volumes or sg-
for security groups.
In this case, the abcd1234
identifier is a unique identifier for the instance. AWS usually assigns a hexadecimal string to each instance to differentiate it from other resources. This naming convention helps users and AWS services identify and reference resources within...