magenx / Magento-2-aws-cluster-terraform

Magento 2 AWS autoscaling cluster with Terraform and Packer or ImageBuilder. Adobe Commerce Cloud alternative. The best ecommerce infrastructure. Drive more sales online. Transparent billing. Developer-friendly. No hidden bottlenecks.
https://www.magenx.com
124 stars 41 forks source link

Specific requirements versions #37

Closed ayoubeddafali closed 4 months ago

ayoubeddafali commented 4 months ago

Hi,

Can you please specify the exact tools versions ( terraform/packer) that you are using to replicate the setup on my AWS account for academic research purposes ?

I keep getting terraform issues when running plan/apply on the main_v5 branch, and am unable to resolve them

Thanks in advance

magenx commented 4 months ago

you can fork it and make sure you have specific versions and parameters provider.tf and packer/packer.pkr.hcl config

this repository code updated all the time with latest versions and features.

ayoubeddafali commented 4 months ago

Thank you for your response, but I guess you misunderstood me.

I've tried with the latest version of terraform, and I keep getting issues such as ( Apologies as I'm not that well versed with the services used )


Error: Invalid function argument

  on cloudfront.tf line 26, in resource "aws_cloudfront_function" "this":
  26:   code    = file("${abspath(path.root)}/cloudfront/function.js")
    ├────────────────
    │ while calling file(path)
    │ path.root is "."

Invalid value for "path" parameter: no file exists at "/home/cloudshell-user/magento/cloudfront/function.js"; this function works only with files that are distributed as part of the configuration source code, so if this file will be created by a resource in this configuration you must
instead obtain this result from an attribute of that resource.

Error: Unsupported attribute

  on lambda.tf line 67, in resource "aws_s3_object" "lambda_image_optimization":
  67:   bucket     = aws_s3_bucket.this["system"].name

Error: Ambiguous attribute key

  on variables.tf line 376, in locals:
 376:       local.rec_regions.US_EAST_2       = local.rec_regions.US_EAST_2

If this expression is intended to be a reference, wrap it in parentheses. If it's instead intended as a literal name containing periods, wrap it in quotes to create a string literal.
magenx commented 4 months ago

typos and syntax will be fixed