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

fix: allow AccountURL function to handle accounts in orgs spanning multiple regions #2080

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mhmcdonald
Copy link
Contributor

This PR addresses an issue with the snowflake_current_account data source. Currently, it's not able to return the account url when the account belongs to an organization that spans multiple region groups. It's currently returning this error when it tries to construct the account URL. The underlying cause of this error is that when an organization spans multiple regions, the current_account() function returns <region_group>.<region>, which is different behavior from when the organization's accounts are in a single region.

The current_region logic is documented here.

This PR also addresses an error in the regionMapping for the aws_us_gov_east_1 region.

This PR changes the query that's used for fetching the current account and current region: it adds a new column to that query output to contain the region_group. In case there is ever a need for region_group in the future, I've added that to the CurrentAccount type.

It also corrects the url string mapping for aws_us_gov_east_1 region.

Test Plan

  • acceptance tests

References

Closes issue 2067

@sfc-gh-asawicki
Copy link
Collaborator

Hey @mhmcdonald. We all slowly progressing through all issues and PRs in the repository.

The code you have altered is already gone. It was moved during the SDK rewrite to ContextFunctions interface. We will address the problems you mentioned as a part of an upcoming rework of existing resources and datasources https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#our-roadmap.

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.

2 participants