hashicorp / hashicorp/terraform-plugin-sdk

Well known error for "already exists"

Open
#10 4 comments 3 reactions 0 assignees View on GitHub
enhancement upstream-protocol upstream-terraform
Dominant language
Go
Stars
485
Forks
244
Avg merge
19h 57m
Merged PRs (30d)
4

Description

It would be nice to have a well known error core expects from providers when a resource already exists so that it can output the required import syntax:

```go
type AlreadyExistsError struct {
ImportID string
}
```

etc...

This needs to be raised to core as core is what knows the import syntax and the appropriate naming of the resource itself.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how provider errors reach core and how core determines import syntax; the issue identifies those provider and core entry points but names no files or tests. Define the expected well-known already-exists error and its ImportID, then verify that core can produce the appropriate resource import syntax from it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.