-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New data source azurerm_communication_service
#22426
New data source azurerm_communication_service
#22426
Conversation
dc53f7a
to
58f3374
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @myc2h6o
Thanks for this PR - I've taken a look through and left some comments inline, but if we can fix those up then this should otherwise be good to go 👍
Thanks!
|
||
keysResp, err := client.ListKeys(ctx, id) | ||
if err != nil { | ||
return fmt.Errorf("listing keys for %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data sources should gracefully handle having limited permissions, so we shouldn't raise this error when there's a permissions error (presumably a 401?)
if model.PrimaryConnectionString != nil { | ||
state.PrimaryConnectionString = *model.PrimaryConnectionString | ||
} | ||
|
||
if model.PrimaryKey != nil { | ||
state.PrimaryKey = *model.PrimaryKey | ||
} | ||
|
||
if model.SecondaryConnectionString != nil { | ||
state.SecondaryConnectionString = *model.SecondaryConnectionString | ||
} | ||
|
||
if model.SecondaryKey != nil { | ||
state.SecondaryKey = *model.SecondaryKey | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW we can reduce this to:
if model.PrimaryConnectionString != nil { | |
state.PrimaryConnectionString = *model.PrimaryConnectionString | |
} | |
if model.PrimaryKey != nil { | |
state.PrimaryKey = *model.PrimaryKey | |
} | |
if model.SecondaryConnectionString != nil { | |
state.SecondaryConnectionString = *model.SecondaryConnectionString | |
} | |
if model.SecondaryKey != nil { | |
state.SecondaryKey = *model.SecondaryKey | |
} | |
state.PrimaryConnectionString = pointer.From(model.PrimaryConnectionString) | |
state.PrimaryKey = pointer.From(model.PrimaryKey) | |
state.SecondaryConnectionString = pointer.From(model.SecondaryConnectionString) | |
state.SecondaryKey = pointer.From(model.SecondaryKey) |
@tombuildsstuff thanks for reviewing! I've updated the code to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for pushing those changes @myc2h6o
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. |
Close #21736