azavea / terraform-aws-cloudtrail

A Terraform module to create an Amazon Web Services (AWS) CloudTrail Trail.
Apache License 2.0
4 stars 9 forks source link

Module creates S3 bucket with insufficient permissions/policy #2

Open boldandbusted opened 5 years ago

boldandbusted commented 5 years ago

Howdy. Here's my stanza that seem to present the problem:

module "cloudtrail" {
  source  = "azavea/cloudtrail/aws"
  version = "0.1.0"

  project = "company"
  environment = "dev"
  region = "us-west-2"
  create_s3_bucket = true
  s3_bucket_name = "someone-dev-awscloudtraillogs"
  include_global_service_events = true
  is_multi_region_trail = true
  is_organization_trail = false
}

Presents with:

Error: Error applying plan:

1 error(s) occurred:

* module.cloudtrail.aws_cloudtrail.trail: 1 error(s) occurred:                                                            

* aws_cloudtrail.trail: InsufficientS3BucketPolicyException: Incorrect S3 bucket policy is detected for bucket: someone-dev-awscloudtraillogs
        status code: 400, request id: 4cf790f8-da72-4980-a180-67b7570d1c80                                                

Terraform does not automatically rollback in the face of errors.                                                          
Instead, your Terraform state file has been partially updated with                                                        
any resources that successfully completed. Please address the error                                                       
above and apply again to incrementally change your infrastructure.                                                        

Happy to provide more info so you can replicate the problem. Thanks in advance.

charlyrai commented 5 years ago

Hi hectcastro,

I am also getting the same error. Is there any solution provided by you?