I am setting up a "aws_cloud_distribution" with Terraform and attempting to set an ec2 as my origin.
In my module I have:
origin {
domain_name = var.domain_name
origin_id = var.origin_id
}
In the main file I call this module and use the output of the ec2 public dns.
module "cloudfront" {
source = "./modules/cloudfront"
domain_name = module.ec2.ec2_public_dns
origin_id = "myid"
target_origin_id = "myid"
}
When I run plan, I have no issues. However when I run apply and begin the build process I get the following error:
error creating CloudFront Distribution: InvalidArgument: The parameter Origin DomainName does not refer to a valid S3 bucket. status code: 400
I am using terraform 0.13.6 out of some company restrictions to other infra in the company. Is this a Terraform version issue or am I missing something in my configuration steps?