# (HELP) Custom variable for ENV always error

**URL:** <https://forum.serverless.com/t/help-custom-variable-for-env-always-error/7564>\
**Category:** Serverless Framework\
**Tags:** variables\
**Created:** [March 5, 2019, 4:09pm UTC](https://forum.serverless.com/t/help-custom-variable-for-env-always-error/7564 "2019-03-05T16:09:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pisangGoreng](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/pisanggoreng/32/3720_2.png) [@pisangGoreng](https://forum.serverless.com/u/pisangGoreng)\
**Post date:** [March 5, 2019, 4:09pm UTC](https://forum.serverless.com/t/help-custom-variable-for-env-always-error/7564/1 "2019-03-05T16:09:10Z")

</div>

Hi guys,

I’m trying to use s3 service in my project.  
I save costum variabel & use in my provider property

```
service: snapnext

custom:
  imagesBucketName: snapnext-images

provider:
  name: aws
  runtime: nodejs6.10
  iamRoleStatements: # IAM permissions granted to all functions
    - Effect: Allow
      Action:
        - S3:GetObject
      Resource:
        - Fn::Join:
            - ''
            - - 'arn:aws:s3:::'
              - '${self:custom.imagesBucketName}/*'
  environment:
    IMAGES_BUCKET_NAME: ${self:custom.imagesBucketName}

functions:
  downloadImage: # Define a new Function
    handler: functions/downloadImage.handler
    events:
      - http:
          path: images
          method: post

resources:
  Resources:
    ImagesBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: ${self:custom.imagesBucketName}
        AccessControl: PublicRead

plugins:
  - serverless-offline

```

When I’m trying to deploy, I’m always getting an error message like this

 ![33%20PM](https://canada1.discourse-cdn.com/flex036/uploads/serverless/original/2X/1/14a3c0a8c892f48e5ee3ca39146ec9ce2a842105.jpeg)

Any idea why this happens?  
And how to better way to debug in a serverless framework, especially for .yml file?

Many Thanks
