The finished repository of the tutorial Amazon Cloudfront: Origin request policy (tutorial).
Learn how to add origin request policy to your Cloudfront distribution using terraform
- Build the lambda function (under
functions/*
)
pnpm run generate-assets --filter "@functions/*"
- Apply the infrastructure
export AWS_ACCESS_KEY_ID=<your-key>
export AWS_SECRET_ACCESS_KEY=<your-secret>
export AWS_DEFAULT_REGION=us-east-1
terraform init
terraform plan
terraform apply -auto-approve