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
123 stars 41 forks source link

Terraform issues on Lambda & media policy #38

Open ayoubeddafali opened 1 month ago

ayoubeddafali commented 1 month ago

I guess after adding the new changes for media optimization with lamda, terraform seems to fail due to some issues

  1. Invalid Actions & Resources at : │ │ with aws_s3_bucket_policy.media, │ on s3.tf line 165, in resource "aws_s3_bucket_policy" "media": │ 165: resource "aws_s3_bucket_policy" "media" { │

  2. InvalidParameterValueException: The provided execution role does not have permissions to call CreateNetworkInterface on EC2 │ │ with aws_lambda_function.image_optimization, │ on lambda.tf line 75, in resource "aws_lambda_function" "image_optimization": │ 75: resource "aws_lambda_function" "image_optimization" {

ayoubeddafali commented 1 month ago

@magenx Thanks

I still get the following error for the media policy

╷
│ Error: putting S3 Bucket (magento-p4j3c18-media) Policy: operation error S3: PutBucketPolicy, https response error StatusCode: 400, RequestID: YJFN1Y05FT2QG4VM, HostID: Kjdiu4Ek+w0rEy3gnq5tuv1PMY5PXBcSilfYepWMh8Pir/gqGZP0/UOLQzQvoVtPlefxTAFjjos=, api error MalformedPolicy: Policy has invalid resource
│ 
│   with aws_s3_bucket_policy.media,
│   on s3.tf line 164, in resource "aws_s3_bucket_policy" "media":
│  164: resource "aws_s3_bucket_policy" "media" {
│ 
╵

Not sure what the resource in question is. Do you get the same error ?