APPLICATION_NAME required
Asked by Naveen Chaudhary:

I have a pipeline to ec2 and using aws ec2 codedeploy pipe and i have set all variables.Bur still I am getting error.

For reference check screenshot:![Screenshot from 2022-06-27 02-57-06.png](https://community.atlassian.com/t5/image/serverpage/image-id/203473iA695012491B6B807/image-size/large?v=v2&px=999 "Screenshot from 2022-06-27 02-57-06.png")![Screenshot from 2022-06-27 02-58-08.png](https://community.atlassian.com/t5/image/serverpage/image-id/203474i32F4AFDE41A9C72B/image-size/large?v=v2&px=999 "Screenshot from 2022-06-27 02-58-08.png")


Answers:
author: Igor Stoyanov
body: [@Naveen Chaudhary](/t5/user/viewprofilepage/user-id/4974741) hi . Thanks for your question.  

You have problems with linting:  
You have this:

```
script:
  - pipe: atlassian/aws-code-deploy:1.1.1
    variables:
    APPLICATION_NAME: 'my-application'
```

but should be this:

```
script:
  - pipe: atlassian/aws-code-deploy:1.1.1
    variables:
      APPLICATION_NAME: 'my-application'
```

Check[this guide](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#variables) for more info.  

Regards, Igor.  


author: Patrik S
body: Hello [@Naveen Chaudhary](/t5/user/viewprofilepage/user-id/4974741) ,

It seems like you pipe if failing in the validation of the APPLICATION_NAME variable, that is a required variable in [aws-code-deploy pipe](https://bitbucket.org/atlassian/aws-code-deploy/src/master/) :

* <https://bitbucket.org/atlassian/aws-code-deploy/src/a191478fa493e985d6ef823f90d619e1eec9f834/pipe/pipe.py#lines-80>

Although from your screenshot you are already defining this variable, to make sure there's no typo in your bitbucket-pipelines.yml file, I would suggest copy/paste the variable from below, replacing it in your yml and try running again :  

```
APPLICATION_NAME: 'my-application'
```

If that still does not work, could you please share the full logs of the pipe run? I'm especially interested in the beginning of the pipe logs, where it describes all the variables passed from the build container to the pipe's container.

Also, could you please confirm if you have any [environment variable](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#User-defined-variables) at the workspace/repository/deployment level with the same name as APPLICATION_NAME ?

Thank you, [@Naveen Chaudhary](/t5/user/viewprofilepage/user-id/4974741)

Kind regards,

Patrik S

comments: author: Naveen Chaudhary
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)As you have suggested i have copy and paste the APPLICATION_NAME variable,but still it is not working.

Please check logs below.

Logs:-

+ umask 000

+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="master" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR  
Cloning into '/opt/atlassian/pipelines/agent/build'...

+ git reset --hard 2fc3c748e99b6075049a6feb3a713e476a17cb85  
HEAD is now at 2fc3c74 <https://bitbucket.org/naveen004/calibrate/src/2fc3c748e99b6075049a6feb3a713e476a17cb85/bitbucket-pipelines.yml> edited online with Bitbucket

+ git config user.name bitbucket-pipelines

+ git config user.email commits-noreply@bitbucket.org

+ git config push.default current

+ git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy <http://localhost:29418/>

+ git remote set-url origin <http://bitbucket.org/$BITBUCKET_REPO_FULL_NAME>

+ git reflog expire --expire=all --all

+ echo ".bitbucket/pipelines/generated" \>\> .git/info/exclude

+ chmod 777 $BUILD_DIR

Images used:  
build : docker.io/library/python@sha256:9e0b4f32487ca1863b45383420b8db77990debae748e2e875d2f86fa9510d4a5  
+ docker container run \\  
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \\  
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \\  
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \\  
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \\  
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/aws-code-deploy:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/aws-code-deploy \\  
--workdir=$(pwd) \\  
--label=org.bitbucket.pipelines.system=true \\  
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \\  
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \\  
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \\  
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \\  
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \\  
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \\  
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID="$BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID" \\  
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \\  
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \\  
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \\  
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \\  
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT="$BITBUCKET_DEPLOYMENT_ENVIRONMENT" \\  
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \\  
--env=CI="$CI" \\  
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \\  
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \\  
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \\  
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \\  
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \\  
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \\  
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \\  
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \\  
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \\  
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \\  
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \\  
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \\  
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/aws-code-deploy" \\  
--env=AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \\  
--env=AWS_DEFAULT_REGION="$AWS_DEFAULT_REGION" \\  
--env=AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \\  
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \\  
bitbucketpipelines/aws-code-deploy:1.1.1  
Unable to find image 'bitbucketpipelines/aws-code-deploy:1.1.1' locally  
1.1.1: Pulling from bitbucketpipelines/aws-code-deploy  
7d63c13d9b9b: Pulling fs layer  
6ad2a11ca37b: Pulling fs layer  
e9edbe81a001: Pulling fs layer  
36629b83aba2: Pulling fs layer  
3baebd9b1d65: Pulling fs layer  
c2702d8b887f: Pulling fs layer  
2f30aab3c4d5: Pulling fs layer  
ccf4689ddb89: Pulling fs layer  
e2879c9c94a9: Pulling fs layer  
c2702d8b887f: Waiting  
36629b83aba2: Waiting  
e2879c9c94a9: Waiting  
3baebd9b1d65: Waiting  
ccf4689ddb89: Waiting  
6ad2a11ca37b: Verifying Checksum  
6ad2a11ca37b: Download complete  
e9edbe81a001: Verifying Checksum  
e9edbe81a001: Download complete  
36629b83aba2: Download complete  
7d63c13d9b9b: Verifying Checksum  
7d63c13d9b9b: Download complete  
c2702d8b887f: Verifying Checksum  
c2702d8b887f: Download complete  
3baebd9b1d65: Verifying Checksum  
3baebd9b1d65: Download complete  
ccf4689ddb89: Download complete  
2f30aab3c4d5: Verifying Checksum  
2f30aab3c4d5: Download complete  
e2879c9c94a9: Verifying Checksum  
e2879c9c94a9: Download complete  
7d63c13d9b9b: Pull complete  
6ad2a11ca37b: Pull complete  
e9edbe81a001: Pull complete  
36629b83aba2: Pull complete  
3baebd9b1d65: Pull complete  
c2702d8b887f: Pull complete  
2f30aab3c4d5: Pull complete  
ccf4689ddb89: Pull complete  
e2879c9c94a9: Pull complete  
Digest: sha256:518d1c7aa618c5cfbc5174797580bb237d4c2965139878e46199f518779a1a93  
Status: Downloaded newer image for bitbucketpipelines/aws-code-deploy:1.1.1  
\[34mINFO: Using default authentication with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY\[0m  
\[31m? Validation error: APPLICATION_NAME variable is required.\[0m  
Searching for files matching artifact pattern .bitbucket/pipelines/generated/pipeline/pipes/\*\*

Searching for test report files in directories named \[test-results, failsafe-reports, test-reports, TestResults, surefire-reports\] down to a depth of 4  
Finished scanning for test reports. Found 0 test report files.  
Merged test suites, total number tests is 0, with 0 failures and 0 errors.


Tags: aws

aws-codedeploy

bitbucket-cloud

bitbucket-pipelines

cloud