Hello All,
I want to host a static website using an S3 bucket. I have written the following code:
module "s3" {
source = "terraform-aws-modules/s3-bucket/aws"
version = "1.19.0"
bucket = "s3bucketcopeland"
acl = "public-read"
versioning = {
enabled = true
}
website = {
index_document = "index.html"
error_document = "error.html"
}
tags = {
Environment = "dev"
Terraform = "true"
}
}
resource "aws_s3_bucket_website_configuration" "s3bucketcopeland"{
bucket = aws_s3_bucket.s3bucketcopeland.id
index_document = "index.html"
error_document = "error.html"
}
Yet, I receive the following error:
A managed resource "aws_s3_bucket" "s3bucketcopeland" has not been declared in the root module.
I thought that I was declaring the bucket with the module entry. What am I getting wrong?