-
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 Resource : azurerm_voice_services_communications_gateway
#20607
New Resource : azurerm_voice_services_communications_gateway
#20607
Conversation
95e2df9
to
df4cb60
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.
Thanks @sinbai, left some comments in-line but once those are resolved we can take another look and get this merged!
internal/services/voiceservices/voice_services_communications_gateway_resource.go
Outdated
Show resolved
Hide resolved
internal/services/voiceservices/voice_services_communications_gateway_resource.go
Outdated
Show resolved
Hide resolved
internal/services/voiceservices/voice_services_communications_gateway_resource.go
Outdated
Show resolved
Hide resolved
|
||
"tags": commonschema.Tags(), | ||
|
||
"teams_voicemail_pilot_number": { |
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.
Is this a number or a string?
"teams_voicemail_pilot_number": { | |
"microsoft_teams_voicemail_pilot_number": { |
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.
The microsoft_teams_voicemail_pilot_number
is a string since the type of API is string.
internal/services/voiceservices/voice_services_communications_gateway_resource.go
Outdated
Show resolved
Hide resolved
if properties.ApiBridge != nil && *properties.ApiBridge != nil { | ||
apiBridgeValue, err := json.Marshal(*properties.ApiBridge) | ||
if err != nil { | ||
return 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.
return err | |
return fmt.Errorf("marshalling value for ApiBridge: %+v", 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.
Fixed.
for _, v := range inputList { | ||
input := v | ||
output := communicationsgateways.ServiceRegionProperties{ | ||
Name: input.Name, | ||
} | ||
|
||
primaryRegionPropertiesValue := expandPrimaryRegionPropertiesModel(input.PrimaryRegionProperties) |
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.
for _, v := range inputList { | |
input := v | |
output := communicationsgateways.ServiceRegionProperties{ | |
Name: input.Name, | |
} | |
primaryRegionPropertiesValue := expandPrimaryRegionPropertiesModel(input.PrimaryRegionProperties) | |
for _, v := range inputList { | |
output := communicationsgateways.ServiceRegionProperties{ | |
Name: v.Name, | |
} | |
primaryRegionPropertiesValue := expandPrimaryRegionPropertiesModel(v.PrimaryRegionProperties) |
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.
Fixed.
var outputList []ServiceRegionPropertiesModel | ||
if inputList == nil { | ||
return outputList | ||
} |
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.
var outputList []ServiceRegionPropertiesModel | |
if inputList == nil { | |
return outputList | |
} | |
outputList := make([]ServiceRegionPropertiesModel, 0) | |
if inputList == nil { | |
return outputList | |
} |
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.
Fixed.
} | ||
|
||
func flattenPrimaryRegionPropertiesModel(input *communicationsgateways.PrimaryRegionProperties) []PrimaryRegionPropertiesModel { | ||
var outputList []PrimaryRegionPropertiesModel |
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.
var outputList []PrimaryRegionPropertiesModel | |
outputList := make([]PrimaryRegionPropertiesModel, 0) |
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.
Fixed.
} | ||
|
||
func flattenCommunicationsPlatformModel(input []communicationsgateways.CommunicationsPlatform) []string { | ||
var output []string |
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.
var output []string | |
output := make([]string, 0) |
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.
Fixed.
Hi @stephybun thanks for your time and feedback. Code has been updated. Could you please take another look? |
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.
Hi @sinbai, there are still two issues in the schema which have not been resolved from the first review, could you please take a look at them? Thanks!
"name": { | ||
Type: pluginsdk.TypeString, | ||
Required: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
}, |
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.
This is still called name
this should be called location
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.
Thanks, the code has been updated. Could you please take another look?
"operator_addresses": { | ||
Type: pluginsdk.TypeSet, | ||
Required: true, | ||
Elem: &pluginsdk.Schema{ | ||
Type: pluginsdk.TypeString, | ||
}, | ||
}, | ||
"allowed_media_source_address_prefixes": { | ||
Type: pluginsdk.TypeSet, | ||
Optional: true, | ||
Elem: &pluginsdk.Schema{ | ||
Type: pluginsdk.TypeString, | ||
}, | ||
}, | ||
|
||
"allowed_signaling_source_address_prefixes": { | ||
Type: pluginsdk.TypeSet, | ||
Optional: true, | ||
Elem: &pluginsdk.Schema{ | ||
Type: pluginsdk.TypeString, | ||
}, | ||
}, | ||
|
||
"esrp_addresses": { | ||
Type: pluginsdk.TypeSet, | ||
Optional: true, | ||
Elem: &pluginsdk.Schema{ | ||
Type: pluginsdk.TypeString, | ||
}, |
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.
These should be flattened and brought a level up, so under service_locations
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.
Thanks, the code has been updated. Could you please take another look?
a067553
to
ec900b2
Compare
ec900b2
to
c253fb5
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.
LGTM 🛻
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.
sorry noticed something on my last pass.
codecs = "PCMA" | ||
platforms = ["OperatorConnect", "TeamsPhoneMobile"] | ||
|
||
service_locations { |
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.
this should be
service_locations { | |
service_location { |
as its a block?
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.
@katbyte thanks for the feedback. The code has been updated. Could you please take another look?
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.
Thanks @sinbai - LGTM 🗨️
This functionality has been released in v3.49.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Support Azure Communications Gateway.
Test Results:
PASS: TestAccVoiceServicesCommunicationsGateway_basic (281.01s)
PASS: TestAccVoiceServicesCommunicationsGateway_requiresImport (309.40s)
PASS: TestAccVoiceServicesCommunicationsGateway_update (671.47s)
PASS: TestAccVoiceServicesCommunicationsGateway_complete (274.35s)