Apply AWS S3 bucket default encryption

My team just create all S3 buckets without any kind of encryption, I just want to know how to apply AES256 default encryption on the wide S3 buckets.

I just found the below resource for s3, but I need to specify all buckets;

resource “aws_s3_bucket” “mybucket” {
bucket = “mybucket”

server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
kms_master_key_id = aws_kms_key.mykey.arn
sse_algorithm = “aws:kms”