Hi guys,
Due to some compliance reasons, we’re being vendor-locked to a local cloud provider who is providing an S3 compatible service.
I’m trying to create a bucket there, but it keeps failing saying
Error: getting S3 Bucket encryption: ServerSideEncryptionConfigurationNotFoundError: The server-side encryption request configuration was not found.
status code: 404, request id: 1685976515119001 , host id: 12391987
My Terraform code for this looks like below
provider "aws" {
access_key = "<ACCESS_KEY>"
region = "us-east-1"
secret_key = "<SECRET_KEY>"
s3_use_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
s3 = "https://DOMAIN-PROVIDED-BY-THE-PROVIDER.com"
sts = "https://DOMAIN-PROVIDED-BY-THE-PROVIDER.com"
}
}
resource "aws_s3_bucket" "example" {
bucket = "example-may-2023"
}
However, the bucket was still created successfully. When I ran terraform apply
again, it still failed with the same error, though.
Error: getting S3 Bucket encryption: ServerSideEncryptionConfigurationNotFoundError: The server-side encryption request configuration was not found.
status code: 404, request id: 1685976743198164, host id: 12327843```
So I destroyed everything and tried again, trying to configure a aws_s3_bucket_server_side_encryption_configuration
resource with an explicit dependency on the bucket as follows:
provider "aws" {
access_key = "<ACCESS_KEY>"
region = "us-east-1"
secret_key = "<SECRET_KEY>"
s3_use_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
s3 = "https://DOMAIN-PROVIDED-BY-THE-PROVIDER.com"
sts = "https://DOMAIN-PROVIDED-BY-THE-PROVIDER.com"
}
}
resource "aws_s3_bucket" "example" {
bucket = "example-may-2023"
}
resource "aws_s3_bucket_server_side_encryption_configuration" "example" {
bucket = aws_s3_bucket.example.bucket
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
depends_on = [aws_s3_bucket.example]
}
Unfortunately, this one failed as well with the same error
Error: getting S3 Bucket encryption: ServerSideEncryptionConfigurationNotFoundError: The server-side encryption request configuration was not found.
status code: 404, request id: 1685977250774298, host id: 12391987
Could you please help check if there is something wrong here? Or the problem mainly comes from our service provider?
Thank you very much for your help, guys.