Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Cognitive Deployment Resource Requires Version Field Incorrectly #24318

Closed
1 task done
tgoodsell-tempus opened this issue Dec 22, 2023 · 3 comments · Fixed by #24264
Closed
1 task done

Azure Cognitive Deployment Resource Requires Version Field Incorrectly #24318

tgoodsell-tempus opened this issue Dec 22, 2023 · 3 comments · Fixed by #24264

Comments

@tgoodsell-tempus
Copy link

tgoodsell-tempus commented Dec 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.5.7

AzureRM Provider Version

3.85.0

Affected Resource(s)/Data Source(s)

azurerm_cognitive_deployment

Terraform Configuration Files

resource "azurerm_cognitive_deployment" "model" {

  name                 = "gpt-4-32k"
  cognitive_account_id = "my-azure-cognitive-account-id"
  model {
    format  = "OpenAI"
    name    = "gpt-4-32k"
    # version = "0613"
  }

  scale {
    type     = "Standard"
    capacity = 10
  }
}

Debug Output/Panic Output

Required attribute "version" not specified: An attribute named "version" is required here

Expected Behaviour

Per the API documentation, the version field should be optional: https://learn.microsoft.com/en-us/rest/api/cognitiveservices/accountmanagement/deployments/create-or-update?view=rest-cognitiveservices-accountmanagement-2023-05-01&tabs=HTTP#deploymentmodel

When not passed, Azure automatically assigns the default version for the model at the time. So really this should be both optional and computed.

Actual Behaviour

The version field is required.

Steps to Reproduce

  1. Create configuration similar to example.
  2. Notice how version is required.

Important Factoids

No response

References

https://learn.microsoft.com/en-us/rest/api/cognitiveservices/accountmanagement/deployments/create-or-update?view=rest-cognitiveservices-accountmanagement-2023-05-01&tabs=HTTP#deploymentmodel

@liuwuliuyun
Copy link
Contributor

Hi @tgoodsell-tempus, thanks for raising this issue. I notice this issue a few days ago and raised PR to fix this. I will link the PR to this issue later. Currently provider design will no longer add new property that is Optional and Computed. But user could use ignore_change to manually ignore changes in this field.

@tgoodsell-tempus
Copy link
Author

Hi @tgoodsell-tempus, thanks for raising this issue. I notice this issue a few days ago and raised PR to fix this. I will link the PR to this issue later. Currently provider design will no longer add new property that is Optional and Computed. But user could use ignore_change to manually ignore changes in this field.

I'm curious, why is adding properties with both optional and computed stopped here? That's not something the SDKv2 docs explicitly recomend avoiding or anything (https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#computed).

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants