Troubleshoot AWS Lambda Deployment

Solutions for issues you might encounter while deploying AWS Lambda functions using the Armory CD-as-a-Service.

AWS Lamba Troubleshooting

CD-as-a-Service returns errors thrown by AWS Lambda. If you encounter an error, be sure to check the AWS Lambda docs’ troubleshooting section.

InvalidParameterValueException / PermanentRedirect

AWSCreateLambdaError: operation error 
Lambda: CreateFunction, https response error 
StatusCode: 400, 
RequestID: ce98341e-8aa6-4c42-99e1-544245303295, 
InvalidParameterValueException: Error occurred while GetObject. 
S3 Error Code: PermanentRedirect. 
S3 Error Message: The bucket is in this region: us-east-2. Please use this region to retry the request

You need to have an S3 bucket with your function archive in the region you want to deploy your function to. This is an AWS constraint.

For example (same AWS Account):

FunctionTarget and RegionS3 Bucket RegionBucket NameFunction Path
hello-world.zipDev: us-east-1us-east-1lambda-us-east-1s3://lambda-us-east-1/hello-world.zip
hello-world.zipStaging: us-east-2us-east-2lambda-us-east-1s3://lambda-us-east-2/hello-world.zip
hello-world.zipInfosec: us-west-1us-west-1lambda-us-east-1s3://lambda-us-west-1/hello-world.zip
hello-world.zipProd: us-west-2us-west-2lambda-us-east-1s3://lambda-us-west-2/hello-world.zip
hello-world.zipProd: eu-central-1eu-central-1lambda-eu-central-1s3://lambda-eu-central-1/hello-world.zip

For more details, see the AWS Lambda InvalidParameterValueException and PermanentRedirect troubleshooting docs.

ResourceConflictException

AWSUpdateLambdaError: operation error
Lambda: UpdateFunctionCode, https response error
StatusCode: 409, 
RequestID: 8027c7ee-0762-4027-a238-2c636a716d48, 
ResourceConflictException: Conflict due to concurrent requests on this function. Please try this request again.

You see this error when you have concurrent deployments to same region.

For example, deploying this config results in a ResourceConflictException error. The staging and audit targets both deploy to us-east-2 and depend on dev, so CD-as-a-Service deploys them concurrently.

version: v1
kind: lambda
application: Sweet Potato Lambda
description: Sweet Potato facts from a Lambda function
deploymentConfig:
  timeout:
    unit: minutes
    duration: 10
targets:
  dev:
    account: armory-docs-dev
    deployAsIamRole: arn:aws:iam::111111111111:role/ArmoryRole
    region: us-east-1
    strategy: allAtOnce
  staging:
    account: armory-docs-dev
    deployAsIamRole: arn:aws:iam::111111111111:role/ArmoryRole
    region: us-east-2
    strategy: allAtOnce
    constraints:
      dependsOn:
        - dev
  audit:
    account: armory-docs-dev
    deployAsIamRole: arn:aws:iam::111111111111:role/ArmoryRole
    region: us-east-2
    strategy: allAtOnce
    constraints:
      dependsOn:
        - dev

The fix for this is to deploy audit to a different region or a different AWS Account.


Last modified November 17, 2023: (c0ecaea)