2
votes

I am trying to deploy a lambda function through CodeDeploy. I have everything set up except my AppSpec file. Since I am deploying a Lambda and not an EC2 instance, I believe that my AppSpec file should be something like this (JSON).

{
"version": 0.0,
"Resources": [{
    "myLambdaFunction": {
        "Type": "AWS::Lambda::Function",
        "Properties": {
            "Name": "myLambdaFunction",
            "Alias": "myLambdaFunctionAlias",
            "CurrentVersion": "1",
            "TargetVersion": "2"
        }
    }
}],
"Hooks": [{
        "BeforeAllowTraffic": "LambdaFunctionToValidateBeforeTrafficShift"
  },
  {
        "AfterAllowTraffic": "LambdaFunctionToValidateAfterTrafficShift"
    }
]
}

However, when I run "deploy" with this AppSpec, it fails. I am not sure where to look for the information to fill these fields. Is it on my local machine or on AWS somewhere? Or should I use different logic for CodeDeploy Lambda deployment? My end goal is to tie my GitHub mono repo through CodeDeploy and Lambda so it can be deployed across multiple instances.

1

1 Answers

0
votes

It's not clear what you're looking for. There will be no useful information on your local machine because you're doing a Lambda deployment with CodeDeploy. I would start in the CodeDeploy console for more information - it should include information as to why your deployment failed. Next, you should look in the Lambda console and CloudWatch Logs to get more information.