mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: Only read S3 bucket policy if it's set
This commit is contained in:
parent
18bd206c38
commit
59a7a5ca27
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user