diff --git a/src/content/docs/aws/tutorials/s3-static-website-terraform.mdx b/src/content/docs/aws/tutorials/s3-static-website-terraform.mdx index 27d59827..78c72996 100644 --- a/src/content/docs/aws/tutorials/s3-static-website-terraform.mdx +++ b/src/content/docs/aws/tutorials/s3-static-website-terraform.mdx @@ -169,7 +169,9 @@ provider "aws" { We would also need to avoid issues with routing and authentication (as we do not need it). Therefore we need to supply some general parameters. Additionally, we have to point the individual services to LocalStack. -We can do this by specifying the `endpoints` parameter for each service, that we intend to use. +We can do this by specifying the `endpoints` parameter for each service that we intend to use. + +When using LocalStack, set `s3_use_path_style = true` so that S3 requests use path-style URLs, which LocalStack expects for the local endpoint. Our `provider.tf` file should look like this: ```hcl showLineNumbers @@ -180,12 +182,13 @@ provider "aws" { # only required for non virtual hosted-style endpoint use case. # https://registry.terraform.io/providers/hashicorp/aws/latest/docs#s3_force_path_style - s3_use_path_style = false + s3_use_path_style = true skip_credentials_validation = true skip_metadata_api_check = true endpoints { s3 = "http://s3.localhost.localstack.cloud:4566" + s3control = "http://localhost.localstack.cloud:4566" } } ```