Skip to content

Commit

Permalink
Addressed review comments - Updated IDF open search module version, A…
Browse files Browse the repository at this point in the history
…dded Port as configurable parameter
  • Loading branch information
saikatak committed May 23, 2024
1 parent d3ab066 commit ad0e94d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifests/fmops-qna-rag/storage-modules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: opensearch
path: git::https://github.com/awslabs/idf-modules.git//modules/storage/opensearch/
path: git::https://github.com/awslabs/idf-modules.git//modules/storage/opensearch?ref=release/1.7.0&depth=1
targetAccount: primary
targetRegion: us-east-1
parameters:
Expand Down
2 changes: 1 addition & 1 deletion manifests/storage-modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ parameters:
value: DESTROY
---
name: opensearch
path: git::https://github.com/awslabs/idf-modules.git//modules/storage/opensearch/
path: git::https://github.com/awslabs/idf-modules.git//modules/storage/opensearch?ref=release/1.7.0&depth=1
targetAccount: primary
targetRegion: us-east-1
parameters:
Expand Down
2 changes: 2 additions & 0 deletions modules/fmops/qna-rag/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def _param(name: str) -> str:
vpc_id = os.getenv(_param("VPC_ID"))
cognito_pool_id = os.getenv(_param("COGNITO_POOL_ID"))
os_domain_endpoint = os.getenv(_param("OS_DOMAIN_ENDPOINT"))
os_domain_port = os.getenv(_param("OS_DOMAIN_PORT"), "443")
os_security_group_id = os.getenv(_param("OS_SECURITY_GROUP_ID"))
input_asset_bucket_name = os.getenv(_param("INPUT_ASSET_BUCKET"))

Expand All @@ -42,6 +43,7 @@ def _param(name: str) -> str:
vpc_id=vpc_id,
cognito_pool_id=cognito_pool_id,
os_domain_endpoint=os_domain_endpoint,
os_domain_port=os_domain_port,
os_security_group_id=os_security_group_id,
os_index_name="rag-index",
input_asset_bucket_name=input_asset_bucket_name,
Expand Down
3 changes: 2 additions & 1 deletion modules/fmops/qna-rag/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(
vpc_id: str,
cognito_pool_id: str,
os_domain_endpoint: str,
os_domain_port: str,
os_security_group_id: str,
os_index_name: str,
input_asset_bucket_name: Optional[str],
Expand Down Expand Up @@ -95,7 +96,7 @@ def __init__(
)
os_security_group.add_ingress_rule(
peer=security_group,
connection=ec2.Port.tcp(443),
connection=ec2.Port.tcp(int(os_domain_port)),
description="Allow inbound HTTPS to open search from embeddings lambda and question answering lambda",
)

Expand Down
1 change: 1 addition & 0 deletions modules/fmops/qna-rag/tests/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def stack_model_package_input() -> cdk.Stack:
vpc_id=vpc_id,
cognito_pool_id=cognito_pool_id,
os_domain_endpoint=os_domain_endpoint,
os_domain_port="443",
os_security_group_id=os_security_group_id,
os_index_name="sample",
input_asset_bucket_name="input-bucket",
Expand Down

0 comments on commit ad0e94d

Please sign in to comment.