All the information you need should be present : Amazon documentation Appspec File.
File location
To verify that you have placed your AppSpec file in the root directory
of the application's source content's directory structure
Add an Application Specification File to a Revision for CodeDeploy
Add an AppSpec File for an AWS Lambda Deployment For a deployment to
an AWS Lambda compute platform:
The AppSpec file contains instructions about the Lambda functions to
be deployed and used for deployment validation.
A revision is the same as an AppSpec file.
An AppSpec file can be written using JSON or YAML.
An AppSpec file can be saved as a text file or entered directly into a
console AppSpec editor when creating a deployment. For more
information, see Create an AWS Lambda Compute Platform Deployment
(Console).
To create an AppSpec file:
Copy the JSON or YAML template into a text editor or into the AppSpec
editor in the console.
Modify the template as needed.
Use a JSON or YAML validator to validate your AppSpec file. If you use
the AppSpec editor, the file is validated when you choose Create
deployment.
If you use a text editor, save the file. If you use the AWS CLI to
create your deployment, reference the AppSpec file if it's on your
hard drive or in an Amazon S3 bucket. If you use the console, you must
push your AppSpec file to Amazon S3.
Add an AppSpec File for an EC2/On-Premises Deployment
To add an AppSpec file to a revision:
Copy the template into a text editor.
Modify the template as needed.
Use a YAML validator to check the validity of your AppSpec file.
Save the file as appspec.yml in the root directory of the revision.
Run one of the following commands to verify that you have placed your
AppSpec file in the root directory:
For Linux, macOS, or Unix:
find /path/to/root/directory -name appspec.yml
There will be no output
if the AppSpec file is not found there.
For Windows:
dir path\to\root\directory\appspec.yml
A File Not Found error will be
displayed if the AppSpec file is not stored there.
Push the revision to Amazon S3 or GitHub.