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

2544 terraform s3 force delete #2

Merged
merged 2 commits into from
May 21, 2015
Merged

Conversation

m-s-austin
Copy link

This code will delete all files on a bucket and allow the bucket to be deleted immediately

@Carrington
Copy link

+1 to the extent that I'm qualified to evaluate Go style

@m-s-austin
Copy link
Author

Update on this, I have been in communication with people from the hashicorp project. I have made changes to the source code based on their feedback.

I have also performed a test on this by uploading 3000 files into a bucket and then
terraform destroy

Test was successful with no hitches. In my opinion this feature is done and ready to use at this point.

log.Printf("[DEBUG] S3 Bucket attempting to forceDestroy %+v", err)

bucket := d.Get("bucket").(string)
resp, err := s3conn.ListObjects(
Copy link

Choose a reason for hiding this comment

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

@m-s-austin does this have some upper bound of how many it returns? Do we need to paginate this?

Copy link
Author

Choose a reason for hiding this comment

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

1000 items limit. I don't have to paginate because I recurse.

@tehnorm
Copy link

tehnorm commented May 20, 2015

@m-s-austin few comments but over all +1

commit a92fe29
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 20 16:35:38 2015 -0400

    updated to new style of awserr

commit 428271c
Merge: b3bae0e 883e284
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 20 16:29:00 2015 -0400

    Merge branch 'master' into 2544-terraform-s3-forceDelete

commit b3bae0e
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 20 12:06:36 2015 -0400

    removed extra line

commit 85eb40f
Author: Michael Austin <m_austin@me.com>
Date:   Tue May 19 14:27:19 2015 -0400

    stray [

commit d8a405f
Author: Michael Austin <m_austin@me.com>
Date:   Tue May 19 14:24:01 2015 -0400

    addressed feedback concerning parsing of aws error in a more standard way

commit 5b9a5ee
Author: Michael Austin <m_austin@me.com>
Date:   Tue May 19 10:55:22 2015 -0400

    clarify comment to highlight recursion

commit 9104378
Author: Michael Austin <m_austin@me.com>
Date:   Tue May 19 10:51:13 2015 -0400

    addressed feedback about reusing err variable and unneeded parens

commit 95e9c3a
Merge: 2637edf db095e2
Author: Michael Austin <m_austin@me.com>
Date:   Mon May 18 19:15:36 2015 -0400

    Merge branch 'master' into 2544-terraform-s3-forceDelete

commit 2637edf
Author: Michael Austin <m_austin@me.com>
Date:   Fri May 15 15:12:41 2015 -0400

    optimize delete to delete up to 1000 at once instead of one at a time

commit 1441eb2
Author: Michael Austin <m_austin@me.com>
Date:   Fri May 15 12:34:53 2015 -0400

    Revert "hook new resource provider into configuration"

    This reverts commit e14a1ad.

commit b532fa2
Author: Michael Austin <m_austin@me.com>
Date:   Fri May 15 12:34:49 2015 -0400

    this file should not be in this branch

commit 645c0b6
Author: Michael Austin <m_austin@me.com>
Date:   Thu May 14 21:15:29 2015 -0400

    buckets tagged force_destroy will delete all files and then delete buckets

commit ac50cae
Author: Michael Austin <m_austin@me.com>
Date:   Thu May 14 12:41:40 2015 -0400

    added code to delete policy from s3 bucket

commit cd45e45
Author: Michael Austin <m_austin@me.com>
Date:   Thu May 14 12:27:13 2015 -0400

    added code to read bucket policy from bucket, however, it's not working as expected currently

commit 0d3d51a
Merge: 31ffdea 8a3b75d
Author: Michael Austin <m_austin@me.com>
Date:   Thu May 14 08:38:06 2015 -0400

    Merge remote-tracking branch 'hashi_origin/master' into 2544-terraform-s3-policy

commit 31ffdea
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 16:01:52 2015 -0400

    add name for use with resouce id

commit b41c737
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 14:48:24 2015 -0400

    Revert "working policy assignment"
    This reverts commit 0975a70.

commit b926b11
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 14:35:02 2015 -0400

    moved policy to it's own provider

commit 233a5f4
Merge: e14a1ad c003e96
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 12:39:14 2015 -0400

    merged origin/master

commit e14a1ad
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 12:26:51 2015 -0400

    hook new resource provider into configuration

commit 455b409
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 12:26:15 2015 -0400

    dummy resource provider

commit 0975a70
Author: Michael Austin <m_austin@me.com>
Date:   Wed May 13 09:42:31 2015 -0400

    working policy assignment

commit 3ab901d
Author: Michael Austin <m_austin@me.com>
Date:   Tue May 12 10:39:56 2015 -0400

    added policy string to schema
@m-s-austin m-s-austin force-pushed the 2544-terraform-s3-forceDelete branch from a92fe29 to dc698e3 Compare May 20, 2015 23:08
m-s-austin added a commit that referenced this pull request May 21, 2015
merging because this PR has been accepted on hashicorp/master
hashicorp#2007
@m-s-austin m-s-austin merged commit cd10944 into master May 21, 2015
@m-s-austin m-s-austin deleted the 2544-terraform-s3-forceDelete branch May 21, 2015 17:26
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.

3 participants