I've tried variations of the following tf file after reading these docs: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository to import an existing ECR repository.
import {
to = aws_ecr_repository.tamarack_api
id = "arn:aws:ecr:us-west-2:xxxxxxxxxxxx:repository/tamarack-api"
}
resource "aws_ecr_repository" tamarack_api {
name = "tamarack-api"
}
terraform plan gives me this error:
Error: reading ECR Repository (arn:aws:ecr:us-west-2:xxxxxxxxxxxx:repository/tamarack-api): InvalidParameterException: Invalid parameter at 'repositoryName' failed to satisfy constraint: 'must satisfy regular expression '(?:[a-z0-9]+(?:[.-][a-z0-9]+)/)[a-z0-9]+(?:[.-][a-z0-9]+)*''
I tried that regex in https://regex101.com/ using the Go language, but it matches the string tamarack-api. Thanks for any help with this!
Id is only
tamarack-api, notarn:aws:ecr:us-west-2:xxxxxxxxxxxx:repository/tamarack-api: