I'm trying to import a bucket into the tfstate that has a dot in its name by using the command:

terraform import aws_s3_bucket.example.com example.com

bucket name is example.com my resource is built like this

resource "aws_s3_bucket" "example.com" { }

regarding the import i got this error: Unexpected extra operators after address. and tried to escape it with \ but didn't work. as for the resource how can i escape it ? since i tells me name should only have numbers digits dash and hyphen ....


example.com is an invalid name. You can't have . in a resource name in TF. You can only use:

letters, digits, underscores, and dashes