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

commonschema: adding support for Extended Location #97

Closed
wants to merge 1 commit into from

Conversation

tombuildsstuff
Copy link
Contributor

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.

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.
Copy link
Collaborator

@katbyte katbyte left a 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,
Copy link

@neil-yechenwei neil-yechenwei Jan 21, 2022

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,
Copy link

@neil-yechenwei neil-yechenwei Jan 27, 2022

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?

@tombuildsstuff tombuildsstuff marked this pull request as draft February 14, 2022 17:28
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants