Merge pull request #6111 from hashicorp/replace4448

Restrict deregistered AMIs to those owned by self.
This commit is contained in:
Matthew Hooker 2018-04-05 16:30:37 -07:00 committed by GitHub
commit cb90e8b375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ func (s *StepDeregisterAMI) Run(_ context.Context, state multistep.StateBag) mul
)) ))
resp, err := regionconn.DescribeImages(&ec2.DescribeImagesInput{ resp, err := regionconn.DescribeImages(&ec2.DescribeImagesInput{
Owners: aws.StringSlice([]string{"self"}),
Filters: []*ec2.Filter{{ Filters: []*ec2.Filter{{
Name: aws.String("name"), Name: aws.String("name"),
Values: []*string{aws.String(s.AMIName)}, Values: []*string{aws.String(s.AMIName)},