FormidableLabs / terraform-aws-serverless

Infrastructure support for Serverless framework apps, done the right way
https://registry.terraform.io/modules/FormidableLabs/serverless/aws
MIT License
144 stars 19 forks source link

Feature/Option: VPC #10

Closed ryan-roemer closed 5 years ago

ryan-roemer commented 5 years ago

Example CloudFormation IAM policies:

Resources:

  IamPolicyDeveloper:
    Properties:
      PolicyDocument:
        Statement:
        # VPC: Get VPC information in order to be able to deploy serverless
        # with `vpc:` configuration references.
        # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-policies-ec2-console.html
        - Effect: "Allow"
          Action:
          - ec2:DescribeSecurityGroups
          - ec2:DescribeVpcs
          - ec2:DescribeSubnets
          Resource:
          # Must be wildcard: https://iam.cloudonaut.io/reference/ec2.html
          - "*"

  IamPolicyLambdaExecution:
    Properties:
      PolicyDocument:
        Statement:
        # VPC: Create the VPC connection
        # https://docs.aws.amazon.com/lambda/latest/dg/vpc.html
        - Effect: "Allow"
          Action:
          - ec2:CreateNetworkInterface
          - ec2:DescribeNetworkInterfaces
          - ec2:DeleteNetworkInterface
          Resource:
          # Must be wildcard: https://iam.cloudonaut.io/reference/ec2.html
          - "*"