aws conflict_error ai_generated true

An error occurred (ResourceAlreadyExistsException)

ID: aws/resource-already-exists

Also available as: JSON · Markdown
92%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

AWS resource with that name already exists. Use existing or choose different name.

generic

Workarounds

  1. 92% success Use the existing resource — describe/get it to verify it matches your needs
    Use the existing resource — describe/get it to verify it matches your needs

    Sources: https://docs.aws.amazon.com/general/latest/gr/error-responses.html

  2. 88% success For IaC (Terraform/CloudFormation), import the existing resource into your state
    terraform import aws_s3_bucket.example my-bucket

    Sources: https://developer.hashicorp.com/terraform/cli/commands/import

  3. 85% success Use data sources to reference existing resources instead of creating new ones
    Use data sources to reference existing resources instead of creating new ones

    Sources: https://docs.aws.amazon.com/general/latest/gr/error-responses.html

Dead Ends

Common approaches that don't work:

  1. Delete and recreate the resource 75% fail

    May lose data, configurations, or dependent resources

  2. Add a random suffix to the name 60% fail

    Makes resource names unpredictable and hard to manage

Error Chain

Frequently confused with: