aarondfrancis / sidecar

Deploy and execute AWS Lambda functions from your Laravel application.
https://hammerstone.dev/sidecar/docs/main
MIT License
827 stars 56 forks source link

Member must satisfy regular expression pattern #147

Closed alvaro-canepa closed 3 months ago

alvaro-canepa commented 3 months ago

When I run php artisan sidecar:deploy --activate get this response:

[Sidecar] Deploying Wnx\SidecarBrowsershot\Functions\BrowsershotFunction to Lambda as `sc-alvis-local-browsershot`.
          ↳ Environment: local
          ↳ Architecture: x86_64
          ↳ Package Type: Zip
          ↳ Runtime: nodejs20.x
          ↳ Creating new lambda function.
          ↳ Packaging files for deployment.
          ↳ Package unchanged. Reusing s3://bucketname/sidecar/001-18cd1037e1421ee5ad13a6cf1c64ad70.zip.

Aws\Lambda\Exception\LambdaException: Error executing "CreateFunction" on "https://lambda.us-east-1.amazonaws.com/2015-03-31/functions"; AWS HTTP error: Client error: `POST https://lambda.us-east-1.amazonaws.com/2015-03-31/functions` resulted in a `400 Bad Request` response:
{"message":"1 validation error detected: Value 'lambdarole' at 'role' failed to satisfy constraint: Member must satisf (truncated...)
 ValidationException (client): 1 validation error detected: Value 'lambdarole' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+ - {"message":"1 validation error detected: Value 'lambdarole' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+"} in /var/www/alvis.app/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:196

IAM user has these permissions:

AmazonS3FullAccess
AmazonS3ObjectLambdaExecutionRolePolicy
AWSLambda_FullAccess
alvaro-canepa commented 3 months ago

Nevermind, I have wrong aws role name https://github.com/motdotla/node-lambda-template/issues/1#issuecomment-97152616