src/vpce.js
function buildLambdaVPCEndpointSecurityGroup({ name = 'LambdaEndpointSecurityGroup' } = {}) {
  return {
    [name]: {
      Type: 'AWS::EC2::SecurityGroup',
      Properties: {
        GroupDescription: 'Lambda access to VPC endpoints',
        VpcId: {
          Ref: 'VPC',
        },
        SecurityGroupIngress: [
          {
            SourceSecurityGroupId: {
              Ref: 'LambdaExecutionSecurityGroup',
            },
            Description: 'Allow inbound HTTPS traffic from LambdaExecutionSecurityGroup',
            IpProtocol: 'tcp',
            FromPort: 443,
            ToPort: 443,
          },
        ],
        Tags: [
          {
            Key: 'Name',
            Value: {
              'Fn::Join': [
                '-',
                [
                  {
                    Ref: 'AWS::StackName',
                  },
                  'lambda-endpoint',
                ],
              ],
            },
          },
        ],
      },
    },
  };
}
function buildLambdaVPCEndpointSecurityGroup({ name = 'LambdaEndpointSecurityGroup' } = {}) {
  return {
    [name]: {
      Type: 'AWS::EC2::SecurityGroup',
      Properties: {
        GroupDescription: 'Lambda access to VPC endpoints',
        VpcId: {
          Ref: 'VPC',
        },
        SecurityGroupIngress: [
          {
            SourceSecurityGroupId: {
              Ref: 'LambdaExecutionSecurityGroup',
            },
            Description: 'Allow inbound HTTPS traffic from LambdaExecutionSecurityGroup',
            IpProtocol: 'tcp',
            FromPort: 443,
            ToPort: 443,
          },
        ],
        Tags: [
          {
            Key: 'Name',
            Value: {
              'Fn::Join': [
                '-',
                [
                  {
                    Ref: 'AWS::StackName',
                  },
                  'lambda-endpoint',
                ],
              ],
            },
          },
        ],
      },
    },
  };
}
function buildLambdaVPCEndpointSecurityGroup ( { name = 'LambdaEndpointSecurityGroup' } = { } ) { return { [ name ] : { Type : 'AWS::EC2::SecurityGroup' , Properties : { GroupDescription : 'Lambda access to VPC endpoints' , VpcId : { Ref : 'VPC' , } , SecurityGroupIngress : [ { SourceSecurityGroupId : { Ref : 'LambdaExecutionSecurityGroup' , } , Description : 'Allow inbound HTTPS traffic from LambdaExecutionSecurityGroup' , IpProtocol : 'tcp' , FromPort : 443 , ToPort : 443 , } , ] , Tags : [ { Key : 'Name' , Value : { 'Fn::Join' : [ '-' , [ { Ref : 'AWS::StackName' , } , 'lambda-endpoint' , ] , ] , } , } , ] , } , } , } ; }
Build a SecurityGroup to allow the Lambda's access to VPC endpoints over HTTPS.

@param {Object} params
@return {Object}
Build a SecurityGroup to allow the Lambda s access to VPC endpoints over HTTPS .