cn-terraform / terraform-aws-s3-static-website

Terraform Module for AWS to host Static Website on S3
https://registry.terraform.io/modules/cn-terraform/s3-static-website/aws
Apache License 2.0
20 stars 34 forks source link

Error: Variables not allowed #48

Open andygearhart-unity opened 1 year ago

andygearhart-unity commented 1 year ago

When attempting to

module "s3-static-website" {
  source                        = "cn-terraform/s3-static-website/aws"
  version                       = "1.0.3"
  name_prefix                            = "some-prefix"
  website_domain_name           = "some.url.com"
  cloudfront_enable_compression = true
  website_bucket_acl            = "public-read"
  create_acm_certificate        = true
  create_route53_hosted_zone    = true
}

I receive the error:

Error: Variables not allowed

On .tf\modules\s3-static-website\versions.tf line 7: Variables may not be used
here.

versions.tf is having issues with the configuration_aliases line:

terraform {
  required_version = ">= 0.13"
  required_providers {
    aws = {
      source                = "hashicorp/aws"
      version               = ">= 4.0"
      configuration_aliases = [aws.main, aws.acm_provider]
    }
  }
}
afreisinger commented 3 months ago

Hi !, add to version.tf

provider "aws" { alias = "main" region = "us-east-1" } and

provider "aws" { alias = "acm_provider" region = "us-east-2" }