# Set header value for proxied request programatically

**URL:** <https://forum.serverless.com/t/set-header-value-for-proxied-request-programatically/8078>\
**Category:** Serverless Framework\
**Tags:** cloudformation, api-gateway\
**Created:** [April 24, 2019, 8:48am UTC](https://forum.serverless.com/t/set-header-value-for-proxied-request-programatically/8078 "2019-04-24T08:48:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![DrColza](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/drcolza/32/2838_2.png) [@DrColza](https://forum.serverless.com/u/DrColza)\
**Post date:** [May 7, 2019, 10:13am UTC](https://forum.serverless.com/t/set-header-value-for-proxied-request-programatically/8078/3 "2019-05-07T10:13:12Z")

</div>

I’ve found an approach to being able to use the serverless framework and be able to hard code integration request header values and utilise HTTP\_PROXY instead of maintaining a LAMBDA\_PROXY.

I had to write an intermediary python script to programmatically edit the Cloudformation that the serverless tool creates.

Deployment steps as follows:

1. Use the yml fucntion configuration defined in the original post.
2. Create a package, `sls package --package <YOUR_PACKAGE_NAME> --stage <STAGE>`
3. Run the python script to change the `integration.request.header.Authorization` value in the `<YOUR_PACKAGE_NAME>/cloudformation-template-update-stack.json` and `<YOUR_PACKAGE_NAME>/serverless-state.json` files
4. Deploy the package `sls deploy --package <YOUR_PACKAGE_NAME> --stage <STAGE>`

I bundled these commands together in a Makefile so I could call a single command for packaging, updating and deploying:

`make deploy-<STAGE>`

---

_[View the full topic](https://forum.serverless.com/t/set-header-value-for-proxied-request-programatically/8078)._
