# Deploy Your Serverless Infrastructure

**URL:** <https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167>\
**Category:** Chapter Comments\
**Created:** [May 9, 2018, 11:16pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167 "2018-05-09T23:16:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [May 9, 2018, 11:16pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/1 "2018-05-09T23:16:48Z")

</div>

Link to chapter - [https://serverless-stack.com/chapters/deploy-your-serverless-infrastructure.html](https://serverless-stack.com/chapters/deploy-your-serverless-infrastructure.html)

---

<div class="post-metadata">

**Author:** ![peetss](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/peetss/32/546_2.png) [@peetss](https://discourse.sst.dev/u/peetss)\
**Post date:** [July 23, 2018, 3:04am UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/2 "2018-07-23T03:04:29Z")

</div>

After this has been deployed to AWS, is it OK to delete the resources we created manually?

What is the list of services that can be deleted once this step is finished?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [July 27, 2018, 11:09pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/3 "2018-07-27T23:09:15Z")

</div>

Do you mean the services from the first part of the tutorial?

The two parts of the tutorial create complete separate resources. So removing one won’t affect the other.

---

<div class="post-metadata">

**Author:** ![peetss](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/peetss/32/546_2.png) [@peetss](https://discourse.sst.dev/u/peetss)\
**Post date:** [July 28, 2018, 12:38am UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/4 "2018-07-28T00:38:13Z")

</div>

Ya Jay I mean the services we created manually at the beginning (without CloudFormation). It would just be nice if there was a section that went a bit like this:

> Now that we have deployed our resources using CloudFormation, we can go in an delete the ones we created manually: API Gateway, Lambda, Cognito, etc…

---

<div class="post-metadata">

**Author:** ![mperone](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@mperone](https://discourse.sst.dev/u/mperone)\
**Post date:** [July 28, 2018, 4:49pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/5 "2018-07-28T16:49:25Z")

</div>

Related question – this part of the tutorial create a user pool named generically ‘stage’-user-pool rather than ‘stage’-notes-user-pool. Any reason for this? If we start developing multiple apps we would want these to be more easily recognizable no? And what happens if we forgot about this and made another app with the same user pool naming convention… when we tried serverless deploy would it just fail because there’s already a user pool with that name?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [August 1, 2018, 10:57pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/6 "2018-08-01T22:57:22Z")

</div>

@mperone Yeah that’s a good point. It should be `$stage-notes-user-pool` or something of the like.

@peetss Yeah we could add a note. But it’s really up to you if you want to keep those around. I know people don’t necessarily go through the advanced part of the tutorial.

---

<div class="post-metadata">

**Author:** ![JLKoven](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jlkoven/32/227_2.png) [@JLKoven](https://discourse.sst.dev/u/JLKoven)\
**Post date:** [September 9, 2018, 10:21pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/7 "2018-09-09T22:21:11Z")

</div>

Idiot question(s)!

So then, I’ve ran **sudo serverless deploy -v**. Now my aws site is updated! Huzzah!

But. I don’t THINK my client-side stuff ( **app-client** ) is pointing at all that.

Will that be covered in further chapters? (I will be looking into this later, and if I answer my own questions I’ll leave up the answer in an edit)

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [September 10, 2018, 5:49pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/8 "2018-09-10T17:49:39Z")

</div>

Yup. In the next few chapters you’ll be asked to update it.

---

<div class="post-metadata">

**Author:** ![tstarkdk](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@tstarkdk](https://discourse.sst.dev/u/tstarkdk)\
**Post date:** [October 9, 2018, 6:54pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/9 "2018-10-09T18:54:40Z")

</div>

When deploying the new CloudFormation template(s), I get the following error:

```auto
  Error --------------------------------------------------
 
  The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource NotesTable

```

For debugging logs, run again after setting the “SLS\_DEBUG=\*” environment variable.

In my serverless.yml I have the following:

```auto
  iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb:DescribeTable
        - dynamodb:Query
        - dynamodb:Scan
        - dynamodb:GetItem
        - dynamodb:PutItem
        - dynamodb:UpdateItem
        - dynamodb:DeleteItem
      # Restrict our IAM role permissions to
      # the specific table for the stage
      Resource:
        - "Fn::GetAtt": [NotesTable, Arn]

```

---

<div class="post-metadata">

**Author:** ![tstarkdk](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@tstarkdk](https://discourse.sst.dev/u/tstarkdk)\
**Post date:** [October 11, 2018, 6:43am UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/10 "2018-10-11T06:43:04Z")

</div>

So I just cloned the backend api from github, and now I gets another error:

```auto
  An error occurred while provisioning your stack: ListLambdaFunction - Value of property Variables must be an object with String (or simple type) properties.

```

---

<div class="post-metadata">

**Author:** ![tstarkdk](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@tstarkdk](https://discourse.sst.dev/u/tstarkdk)\
**Post date:** [October 11, 2018, 1:11pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/11 "2018-10-11T13:11:16Z")

</div>

I was missing the env.yml file. Apparently its not part of the official github repo?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 11, 2018, 5:51pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/12 "2018-10-11T17:51:41Z")

</div>

Yeah that file isn’t meant to be checked in since it contains sensitive information. I’ll add a note to the repo so it’s not confusing.

---

<div class="post-metadata">

**Author:** ![tstarkdk](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@tstarkdk](https://discourse.sst.dev/u/tstarkdk)\
**Post date:** [October 11, 2018, 6:04pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/13 "2018-10-11T18:04:06Z")

</div>

Or maybe just include the file in the repo, but give the strings a value like “REPLACE THIS WITH YOUR STRIPE KEY”?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 14, 2018, 5:04pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/14 "2018-10-14T17:04:15Z")

</div>

Sorta, we just don’t want to give the impression that the file should be in your Git repo.

---

<div class="post-metadata">

**Author:** ![tstarkdk](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@tstarkdk](https://discourse.sst.dev/u/tstarkdk)\
**Post date:** [October 14, 2018, 5:21pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/15 "2018-10-14T17:21:18Z")

</div>

I totally understand that.

---

<div class="post-metadata">

**Author:** ![kpathakota](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/kpathakota/32/287_2.png) [@kpathakota](https://discourse.sst.dev/u/kpathakota)\
**Post date:** [October 23, 2018, 6:16am UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/16 "2018-10-23T06:16:27Z")

</div>

Hi @jayair - When I tried to deploy, I get the following cloud formation error:

```auto
    Error --------------------------------------------------
    The CloudFormation template is invalid: Template format error: Unrecognized resource types [AWS::Cognito::UserPool, AWS::Cognito::IdentityPoolRoleAttachment, AWS::Cognito::UserPoolClient, AWS::Cognito::IdentityPool]

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

```

Any tips on what I can try next? I validated that those are indeed CloudFormation resource types: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html)

---

<div class="post-metadata">

**Author:** ![leogonzalez](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@leogonzalez](https://discourse.sst.dev/u/leogonzalez)\
**Post date:** [October 25, 2018, 11:34pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/17 "2018-10-25T23:34:22Z")

</div>

@kpathakota I am having the same problem. In my case is because my default region does not support Cognito. You can fix that by running `sls deploy -v --region us-east-1`

What I am really trying to figure out is how to leave my whole stack as sa-east-1 (does not support cognito) and have cognito on the us-east-1 region. @jayair or anyone else - could you help me? Thanks in advance

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 28, 2018, 2:13am UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/18 "2018-10-28T02:13:32Z")

</div>

I haven’t tried it but conceptually it should be possible?

What’s the issue you are running into?

Btw, @kpathakota did @leogonzalez’s tip work for you?

---

<div class="post-metadata">

**Author:** ![kpathakota](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/kpathakota/32/287_2.png) [@kpathakota](https://discourse.sst.dev/u/kpathakota)\
**Post date:** [October 29, 2018, 12:35am UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/19 "2018-10-29T00:35:48Z")

</div>

@jayair - yes, worked! @leogonzalez - thanks! That was exactly it. Makes sense that the region did not understand that particular CloudFormation template if it’s not available.

---

<div class="post-metadata">

**Author:** ![leogonzalez](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@leogonzalez](https://discourse.sst.dev/u/leogonzalez)\
**Post date:** [October 29, 2018, 4:45pm UTC](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167/20 "2018-10-29T16:45:29Z")

</div>

Thanks @jayair - I want to run my entire stack in Sao Paulo (sa-east-1) since response times are better (90% better than us-east-1 for me) except cognito (us-east-1) since the service is not available here.

running `sls deploy -v --region sa-east-1` throws the error since cognito is not available, so I was wondering how can I override the region for a specific service (Cognito) within my YML file.

[Next page](https://discourse.sst.dev/t/deploy-your-serverless-infrastructure/167.md?page=2)
