# Referencing HttpApi base URL in serverless.yml

**URL:** <https://forum.serverless.com/t/referencing-httpapi-base-url-in-serverless-yml/12683>\
**Category:** Serverless Framework\
**Tags:** aws, api-gateway\
**Created:** [September 27, 2020, 2:10pm UTC](https://forum.serverless.com/t/referencing-httpapi-base-url-in-serverless-yml/12683 "2020-09-27T14:10:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![alexvdvalk](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/alexvdvalk/32/4449_2.png) [@alexvdvalk](https://forum.serverless.com/u/alexvdvalk)\
**Post date:** [October 1, 2020, 1:50pm UTC](https://forum.serverless.com/t/referencing-httpapi-base-url-in-serverless-yml/12683/2 "2020-10-01T13:50:40Z")

</div>

Serverless Framwork creates an output called “HttpApiUrl” when deploying. I looked in the template update stack that is generated and lifted this CloudFormation code from there. I’m using the JSON format here so you may have to adjust if you’re using yaml.

```
    environment: {
  ImportedValue: {
    "Fn::Join": [
      "",
      [
        "https://",
        {
          Ref: "HttpApi",
        },
        ".execute-api.",
        {
          Ref: "AWS::Region",
        },
        ".",
        {
          Ref: "AWS::URLSuffix",
        },
      ],
    ],
  },
}

```

I hope this helps.

---

_[View the full topic](https://forum.serverless.com/t/referencing-httpapi-base-url-in-serverless-yml/12683)._
