New Resource: azurerm_video_indexer_account#27632
Conversation
| secret_permissions = [ | ||
| "Get", | ||
| "List", | ||
| "List", l |
| } | ||
|
|
||
| type StorageModel struct { | ||
| StorageAccountId string `tfschema:"storage_account_id"` |
There was a problem hiding this comment.
Should this just be named account_id since it's already under a storage block?
| if response.WasNotFound(account.HttpResponse) { | ||
| return metadata.MarkAsGone(id) | ||
| } | ||
| return fmt.Errorf("reading %s: %+v", id, err) |
There was a problem hiding this comment.
| return fmt.Errorf("reading %s: %+v", id, err) | |
| return fmt.Errorf("retrieving %s: %+v", id, err) |
| id, err := accounts.ParseAccountID(metadata.ResourceData.Id()) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| client := metadata.Client.VideoIndexer.AccountClient | ||
| metadata.Logger.Infof("deleting %s", id) | ||
|
|
||
| if _, err := client.Delete(ctx, *id); err != nil { | ||
| return fmt.Errorf("deleting %s: %v", id, err) | ||
| } |
There was a problem hiding this comment.
Really minor, but the ordering of this looks strange to me. Don't we usually define the client first then begin parsing IDs?
There was a problem hiding this comment.
Good shout! That does look weird
| StorageAccountId: pointer.From(input.ResourceId), | ||
| UserAssignedIdentityId: pointer.From(input.UserAssignedIdentity), |
There was a problem hiding this comment.
We should parse the resource IDs that are returned by the API before setting them into state so that we can catch any casing inconsistencies
| if response.WasNotFound(resp.HttpResponse) { | ||
| return utils.Bool(false), nil | ||
| } | ||
| return nil, fmt.Errorf("retreiving %s: %v", id, err) | ||
| } | ||
| if response.WasNotFound(resp.HttpResponse) { | ||
| return utils.Bool(false), nil | ||
| } | ||
| return utils.Bool(true), nil |
There was a problem hiding this comment.
I'm not sure why we might need to specifically check for a 404 status, any error that we get from the API when running the tests and checking that it exists is logically a false, so I think this can be simplified. Let me know if that makes sense or if I've not considered something.
| if response.WasNotFound(resp.HttpResponse) { | |
| return utils.Bool(false), nil | |
| } | |
| return nil, fmt.Errorf("retreiving %s: %v", id, err) | |
| } | |
| if response.WasNotFound(resp.HttpResponse) { | |
| return utils.Bool(false), nil | |
| } | |
| return utils.Bool(true), nil | |
| return nil, fmt.Errorf("retrieving %s: %v", id, err) | |
| } | |
| return pointer.To(true), nil |
There was a problem hiding this comment.
Nah, you're right. Copy pasta strikes again
|
|
||
| data.ResourceTest(t, r, []acceptance.TestStep{ | ||
| { | ||
| Config: r.basic(data), |
There was a problem hiding this comment.
Should this be using
| Config: r.basic(data), | |
| Config: r.userAssignedIdentity(data), |
0671be2 to
5ee3c51
Compare
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
This PR adds
azurerm_video_indexer_accountas a new resource.PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_video_indexer_account[GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.