Skip to content

Instantly share code, notes, and snippets.

@ofhouse
Last active August 30, 2021 18:36
Show Gist options
  • Save ofhouse/bc4dc4d3d296c598ea3adcfa41f67935 to your computer and use it in GitHub Desktop.
Save ofhouse/bc4dc4d3d296c598ea3adcfa41f67935 to your computer and use it in GitHub Desktop.
Initialize Terraform Next.js Image Optimization module for AWS
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
# Main AWS region where the resources should be created in
# Should be close to where your Next.js deployment is located
provider "aws" {
region = "us-east-1"
}
module "next_image_optimizer" {
source = "milliHQ/next-js-image-optimization/aws"
next_image_domains = ["example.com", "sub.example.com"]
}
output "domain" {
value = module.next_image_optimizer.cloudfront_domain_name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment