# Deploying APIKeys in V3

**URL:** <https://forum.serverless.com/t/deploying-apikeys-in-v3/19533>\
**Category:** Serverless Framework\
**Tags:** aws, lambda, api-gateway\
**Created:** [September 22, 2023, 6:16pm UTC](https://forum.serverless.com/t/deploying-apikeys-in-v3/19533 "2023-09-22T18:16:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiaisonLarry](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/liaisonlarry/32/3914_2.png) [@LiaisonLarry](https://forum.serverless.com/u/LiaisonLarry)\
**Post date:** [September 22, 2023, 6:16pm UTC](https://forum.serverless.com/t/deploying-apikeys-in-v3/19533/1 "2023-09-22T18:16:31Z")

</div>

Hi,

I’m trying to migrate our serverless projects from V2 to V3, and I’m struggling with API Keys a bit. In our V2 project, we defined the name and value of the API Keys, and when we deployed, it would see that the key already exists and carry on with the deployment. Now in V3, it is giving me an error because the name already exists, and if I append the stage to the name (_${sls:stage}_), as I saw suggested in the documentation, it’s complaining that the value already exists.

I have moved the definitions under “_provider.apiGateway.apiKeys_” in my main serverless.yml file. Below is the relevant section from serverless.yml (with values changed to protect the innocent):

```auto
provider:
  name: aws
  runtime: java11
  timeout: 30
  versionFunctions: false
  stage: dev
  apiGateway:
    restApiId:
      Ref: CasApiGateway
    restApiRootResourceId:
      Fn::GetAtt:
        - CasApiGateway
        - RootResourceId
    apiKeySourceType: HEADER
    apiKeys:
      - name: Name1
        value: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        description: "Description"

```

How are the API Keys supposed to work in V3 if you can’t redeploy them??
