provider/aws: Only read S3 bucket policy if it's set

This commit is contained in:
Radek Simko 2016-09-18 22:35:07 +01:00
parent 18bd206c38
commit 59a7a5ca27
No known key found for this signature in database
GPG Key ID: 6823F3DCCE01BB19

View File

@ -451,6 +451,7 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
}
// Read the policy
if _, ok := d.GetOk("policy"); ok {
pol, err := s3conn.GetBucketPolicy(&s3.GetBucketPolicyInput{
Bucket: aws.String(d.Id()),
})
@ -468,6 +469,7 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
return err
}
}
}
// Read the CORS
cors, err := s3conn.GetBucketCors(&s3.GetBucketCorsInput{