# Unsupported object format when using Fn::FindInMap

**URL:** <https://forum.serverless.com/t/unsupported-object-format-when-using-fn-findinmap/16048>\
**Category:** Serverless Framework\
**Tags:** aws, lambda, variables\
**Created:** [October 8, 2021, 9:48am UTC](https://forum.serverless.com/t/unsupported-object-format-when-using-fn-findinmap/16048 "2021-10-08T09:48:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jek](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jek/32/6256_2.png) [@jek](https://forum.serverless.com/u/jek)\
**Post date:** [October 8, 2021, 9:48am UTC](https://forum.serverless.com/t/unsupported-object-format-when-using-fn-findinmap/16048/1 "2021-10-08T09:48:54Z")

</div>

How can I get the code below to work? I haven’t been able to find any information on the error.

```auto
service: SomeService
variablesResolutionMode: 20210326
configValidationMode: warn

functions:
  share:
    environment:
      SIMPLE_EMAIL_SERVICE_REGION:
        Fn::FindInMap: [ClosestSESRegion, Ref: 'AWS::Region', SESRegion]

resources:
  Mappings:
    ClosestSESRegion:
      us-east-1:
        SESRegion: us-east-1
      us-west-1:
        SESRegion: us-west-2
      us-west-2:
        SESRegion: us-west-2
      eu-west-1:
        SESRegion: eu-west-1
      eu-west-2:
        SESRegion: eu-west-2
      ap-northeast-1:
        SESRegion: us-east-1
      ap-northeast-2:
        SESRegion: us-west-2
      ap-southeast-1:
        SESRegion: us-west-2
      ap-southeast-2:
        SESRegion: us-west-2
      ap-south-1:
        SESRegion: us-west-2
      us-east-2:
        SESRegion: us-east-1
      sa-east-1:
        SESRegion: us-west-2
      eu-central-1:
        SESRegion: eu-west-1

```

Error:

```auto

Serverless: Configuration warning at 'functions.share.environment.SIMPLE_EMAIL_SERVICE_REGION': unsupported object format

```
