terraform-aws-s3-static-website icon indicating copy to clipboard operation
terraform-aws-s3-static-website copied to clipboard

Error: Variables not allowed

Open andygearhart-unity opened this issue 2 years ago • 2 comments

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]
    }
  }
}

andygearhart-unity avatar Jan 27 '23 20:01 andygearhart-unity

Hi !, add to version.tf

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

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

afreisinger avatar Jul 01 '24 01:07 afreisinger

Hi @andygearhart-unity! Was the issue solved by doing what @afreisinger suggested?

jnonino avatar Feb 26 '25 09:02 jnonino