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 sharing update #404

Merged
merged 4 commits into from
Apr 4, 2023
Merged

Fix sharing update #404

merged 4 commits into from
Apr 4, 2023

Conversation

dlpzx
Copy link
Contributor

@dlpzx dlpzx commented Apr 4, 2023

Feature or Bugfix

  • Bugfix

Detail

When we import a dataset stack, if the S3 location was already registered data.all does not create a storage location. The issue is that for datasets where data.all needs to create a storage location:

  1. the first time that it creates the stack it detects that there is no storage location and it creates the corresponding CFN resource
  2. the first time that it UPDATES the stack it detects the storage location from 1. and it deletes the CFN resource
  3. the next time that it UPDATES the stack it does not detect any storage location (it was deleted in 2.) and it creates the CFN resource again.

To fix this behavior, in V1.5 we will use Lambda custom resource to check the storage location and avoid CFN resources. But for previous versions, this PR includes:

  • in the method that checks the existence of an storage location, we filter by the roleArn of the location. If the roleArn is the dataallPivotRole then we assume that it was created by the dataset, which means that existing_storage_location = False

I tested locally but with actual stacks being created. No additional policies are needed

Relates

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dlpzx dlpzx requested a review from noah-paige April 4, 2023 15:15
Copy link
Contributor

@noah-paige noah-paige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good to me and a very quick fix!

Only note would be to add some additional comments to be more verbose on what we are doing here (it is a little confusing at first glance seeing we return False on both errors and if data all registers location)

@dlpzx dlpzx merged commit 6460986 into main Apr 4, 2023
@dlpzx dlpzx deleted the fix_sharing_update branch April 6, 2023 09:52
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.

None yet

2 participants