Skip to content

Commit 657506b

Browse files
committed
Merge branch 'morosi-lambda' into 'master'
Add vpc_config param to PyFlaskFunction See merge request it/e3-aws!67
2 parents 22f56da + d41c15b commit 657506b

File tree

1 file changed

+9
-1
lines changed
  • src/e3/aws/troposphere/awslambda

1 file changed

+9
-1
lines changed

src/e3/aws/troposphere/awslambda/flask.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def hello_world():
3333
import os
3434

3535
from troposphere import GetAtt
36-
from troposphere.awslambda import LoggingConfig
36+
from troposphere.awslambda import LoggingConfig, VPCConfig
3737
from e3.aws.troposphere.iam.role import Role
3838
from e3.fs import cp
3939
from . import PyFunction
@@ -67,6 +67,7 @@ def __init__(
6767
reserved_concurrent_executions: int | None = None,
6868
environment: dict[str, str] | None = None,
6969
logging_config: LoggingConfig | None = None,
70+
vpc_config: VPCConfig | None = None,
7071
):
7172
"""Initialize a Flask AWS lambda function using a Python runtime.
7273
@@ -90,6 +91,10 @@ def __init__(
9091
:param environment: Environment variables that are accessible from function
9192
code during execution
9293
:param logging_config: The function's Amazon CloudWatch Logs settings
94+
:param vpc_config: For network connectivity to AWS resources in a VPC, specify
95+
a list of security groups and subnets in the VPC. When you connect a
96+
function to a VPC, it can access resources and the internet only
97+
through that VPC
9398
"""
9499
self.app_module, self.app_name = app.rsplit(".", 1)
95100

@@ -108,6 +113,7 @@ def __init__(
108113
reserved_concurrent_executions=reserved_concurrent_executions,
109114
environment=environment,
110115
logging_config=logging_config,
116+
vpc_config=vpc_config,
111117
)
112118

113119
def populate_package_dir(self, package_dir: str) -> None:
@@ -142,6 +148,7 @@ def __init__(
142148
memory_size: int | None = None,
143149
logs_retention_in_days: int | None = None,
144150
logging_config: LoggingConfig | None = None,
151+
vpc_config: VPCConfig | None = None,
145152
):
146153
"""Initialize a Flask AWS lambda function using Python 3.8 runtime.
147154
@@ -160,4 +167,5 @@ def __init__(
160167
memory_size=memory_size,
161168
logs_retention_in_days=logs_retention_in_days,
162169
logging_config=logging_config,
170+
vpc_config=vpc_config,
163171
)

0 commit comments

Comments
 (0)