# Serverless.yml : inheritance doesn't work for aws vpc config

**URL:** <https://forum.serverless.com/t/serverless-yml-inheritance-doesnt-work-for-aws-vpc-config/1364>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [February 21, 2017, 9:49am UTC](https://forum.serverless.com/t/serverless-yml-inheritance-doesnt-work-for-aws-vpc-config/1364 "2017-02-21T09:49:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephanechauvin](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@stephanechauvin](https://forum.serverless.com/u/stephanechauvin)\
**Post date:** [February 21, 2017, 9:49am UTC](https://forum.serverless.com/t/serverless-yml-inheritance-doesnt-work-for-aws-vpc-config/1364/1 "2017-02-21T09:49:59Z")

</div>

As it is mentionned in the [serverless doc](https://serverless.com/framework/docs/providers/aws/guide/functions/#vpc-configuration), the vpc configuration of a function should inherit from the provider vpc configuration.

Or in my case, if I mention the vpc config only for the provider, the function doesn’t inherit this vpc config…

Am I missing something ?

Here is an extract of my basic serverless.yml config :

```
provider:
  name: aws
  runtime: nodejs4.3
  stage: dev
  region: eu-central-1
  memorySize: 128 
  timeout: 5 
  deploymentBucket: XXXXXXX
  versionFunctions: false
  vpc:
    securityGroupsIds:
      - sg-XXXXXX
    subnetIds:
      - subnet-XXXXXXX
      - subnet-XXXXX
  iamRoleStatements:
    - Effect: "Allow" 
      Action:
        - s3:PutObject
        - s3:GetObject
      Resource: "arn:aws:s3:::${self:custom.aws.s3.bucket.name}/${self:custom.aws.s3.bucket.folder.refdata}/*"
    - Effect: "Allow" 
      Action:
        - ec2:CreateNetworkInterface
        - ec2:DescribeNetworkInterfaces
        - ec2:DetachNetworkInterface
        - ec2:DeleteNetworkInterface
      Resource: "*"
functions:
  init:
    handler: handler-init.launch
    description:XXXXXXXX
  # vpc:
  # securityGroupsIds:
  # - sg-ea1afe81
  # subnetIds:
  # - subnet-35cb965c
  # - subnet-f99aea82

```

As soon as I decomment the vpc section of the function, all works fine…

Thanks !  
Stephane

---

<div class="post-metadata">

**Author:** ![stephanechauvin](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@stephanechauvin](https://forum.serverless.com/u/stephanechauvin)\
**Post date:** [February 21, 2017, 10:08am UTC](https://forum.serverless.com/t/serverless-yml-inheritance-doesnt-work-for-aws-vpc-config/1364/2 "2017-02-21T10:08:15Z")

</div>

Ok it’s my bad 😕

I was typing _securityGroup **s** Ids_ in one location and the correct _securityGroupIds_ in another…

Copy paste is my friend 🙂

With the correct syntax, it’s works just fine !

Sorry for the inconvenience  
Stephane
