1
votes

I am trying to import an aws_db_subnet_group. The terraform docs are very limited in explaining how you are supposed to go about doing this other than providing the one line to execute

terraform import aws_db_subnet_group.default <subnet-group-id>

I am searching the AWS console and I cannot find this <subnet-group-id> anywhere. I've ran into this issue a few times now, hunting through the AWS console for a specific resource's ID so that I can import it. Does anyone know where/how to go about doing this in general? And for my current problem, how to find it for an ElastiCache Subnet Group ID?

I referred to the aws elasticache documentation and tried running describe-cache-subnet-groups

aws elasticache describe-cache-subnet-groups --cache-subnet-group-name <name>

But this did not give me any ID related to the cache subnet group that I could use for the import

1

1 Answers

2
votes

First of all, DB subnet groups and ElastiCache subnet groups are two different things. You don't use your db subnet groups for your ElasticCache instances.

From the documentation it seems that both db subnet groups and cache subnet groups are imported by their names, not IDs. You can find your subnet group names in your console:

ElastiCache dashboard - Subnet Groups on the sidebar - Name column

or RDS dashboard - Subnet Groups on the sidebar - Name column