S3 Resource Producing Unreadable Output

I recently updated from aws_s3_bucket_object to aws_s3_bucket and noticed that the output in my aws logs produces unreadable characters.

For example:

6.0_x5: ��m�X�1-���8�,�/PKa,"�?/PK�Z'U!node_modules/lodash/_baseHasIn.jsMP�N�0��+�KE�*��������!��tCL��kh���I�v��y�n���#�*t��dY�v��|�:�ė��%FL
4.{�\�� 7Fv�%��K(v��*��pW��ex���<��@
26.0_x5: �w�o?�%�}8��w�qgAaR���aw?��?�7x���o�ޓ�������N�������S�kI�J,���}��02��''�A#��}��2a����qrB�f����偩�bl��0���0�/���g�Š`�w����&�տ�=���4�

My current bucket setup is as follows

resource "aws_s3_bucket" "heyhey_lambda_sources" {
  bucket = "heyhey-${var.environment_name}-lambda-sources"
  acl    = "private"
  tags = {
    Environment = var.environment_name
    Tenant      = "central"
  }
}

resource "aws_s3_bucket_server_side_encryption_configuration" "example" {
  bucket = aws_s3_bucket.heyhey_lambda_sources.id

  rule {
    apply_server_side_encryption_by_default {
      sse_algorithm     = "aws:kms"
    }
  }
}

At first I figured it was an issue with refactoring aws_s3_bucket_server_side_encryption_configuration. But after I had created the resource the output continues to show the unreadable characters. Could someone advise as to the possible culprit.

1 Like

I found the answer to this. I was using resource “aws_s3_bucket” when instead I should have been using data “aws_s3_object”

1 Like