-
Notifications
You must be signed in to change notification settings - Fork 398
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
[Feature] Add support for Databricks Account Console IP Access Lists #3221
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3221 +/- ##
==========================================
+ Coverage 83.60% 83.61% +0.01%
==========================================
Files 169 169
Lines 15094 15132 +38
==========================================
+ Hits 12619 12653 +34
- Misses 1735 1739 +4
Partials 740 740
|
@nkvuong will we avoid the problem with the new "skip read after write" functionality? |
@alexott let me test this out |
access/resource_ip_access_list.go
Outdated
retry.RetryContext(ctx, 10*time.Minute, func() *retry.RetryError { | ||
_, err := acc.IpAccessLists.GetByIpAccessListId(ctx, ipAclId) | ||
var apiErr *apierr.APIError | ||
if !errors.As(err, &apiErr) { | ||
return retry.NonRetryableError(err) | ||
} | ||
if apiErr.StatusCode == 404 { | ||
return retry.RetryableError(err) | ||
} else { | ||
return retry.NonRetryableError(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.
Should we remove this workaround?
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.
so the issue, we can only enable the Account-level IP ACL after it has been created, so we still need to wait until it has been created. Otherwise the call to enable the ACL will fail
return err | ||
} | ||
} | ||
d.SetId(ipAclId) |
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.
I think that we need to add StructToData
on the result of the acc.IpAccessLists.Create
here (and same for workspace-level create)
access/resource_ip_access_list.go
Outdated
@@ -30,48 +33,86 @@ func ResourceIPAccessList() common.Resource { | |||
}) | |||
return common.Resource{ | |||
Schema: s, | |||
CanSkipReadAfterCreateAndUpdate: func(d *schema.ResourceData) bool { | |||
//only skip read after create | |||
return d.IsNewResource() |
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.
But if we'll have Read after Update, then we may get inconsistent state - API docs explicitly say that it may take a few minutes to propagate.
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Test Details: go/deco-tests/11866584699 |
Changes
databricks_ip_access_list
at account-leveldatabricks_ip_access_list
tests to use MockTests
make test
run locallydocs/
folderinternal/acceptance