Skip to content

[Bug] Terraform provider attempts to recreate existing LiteLLM credentials, causing name conflict errors #8

@shivamrawat1

Description

@shivamrawat1

Applying provider where we already have credentials existing in litellm causes provider to try to create credential anyway and fail due to conflict

Error: failed to create credential: API request failed: Status: 500 Internal Server Error, Response: {"error":{"message":"Internal Server Error, Unique constraint failed on the fields: (`credential_name`)","type":"internal_server_error","param":"None","code":"500"}}
│   with module.config.litellm_credential.aws_bedrock,
│   on modules/credentials.tf line 1, in resource "litellm_credential" "aws_bedrock":
│    1: resource "litellm_credential" "aws_bedrock" {

This is probably because of https://github.com/BerriAI/terraform-provider-litellm/blob/main/litellm/resource_credential.go#L18 forcing recreation. I would expect credential to be overriden on name conflict / removed before recreatedWhat is the recommended approach to using provider in context of credentials creation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions