Added account id to bucket name to ensure uniqueness #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using the default resource prefix of aws-cis yields a bucket name of aws-cis-audit-logs which appears to already exist.
Insert the account id into the bucket name to yield a unique name.
Original error, ideally the AWS API would give a better response for an existing bucket but I see the security issue there:
Error: creating Amazon S3 (Simple Storage) Bucket (aws-cis-audit-logs): AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-central-1' │ status code: 400, request id: AENNHNACK4Z82XND, host id: +5V93mvxTjXkRzWtI34PHJj5alivNUxyzFloJMKQAl2CCmDFdVwkP1M4qYDYJIGl3q3c2bhB8tw= │ │ with aws_s3_bucket.audit[0], │ on s3.tf line 101, in resource "aws_s3_bucket" "audit": │ 101: resource "aws_s3_bucket" "audit" { │ ╵