-
Notifications
You must be signed in to change notification settings - Fork 43
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
commonschema: adding support for Extended Location #97
Conversation
This is a kind of location which has more dynamic names than for the location field as such we'll have to leave this with lax validation for now.
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 🏗️
func ExtendedLocation() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: true, |
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 @tombuildsstuff . Per my understanding, seems it's an optional property. If I am wrong, please correct me. Because it allows customers to take advantage of more granular locations when this property is set. If user doesn't set it, the resource would be deployed to normal location like "West Europe". Does it make sense?
ForceNew: true, | ||
StateFunc: location.StateFunc, | ||
DiffSuppressFunc: location.DiffSuppressFunc, | ||
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.
Though there is a list API to retrieve available extended locations, but it has to be whitelisted by service team first before calling this API. So I assume here is not proper to add a property validation using this API for extendedLocation like the location validation to validate available extendedLocation since it would break existing users/resources when user already knew the extended location so that user doesn't want this check. So if added property validation here, user has to gain the additional permission for this check even if it's unnecessary to users. Does it make sense?
This is a kind of location which has more dynamic names than for the location field as such we'll have to leave this with lax validation for now.