Skip to content

Commit

Permalink
fix(llm): dependency hierarchy of resources
Browse files Browse the repository at this point in the history
  • Loading branch information
kkiani committed Sep 23, 2024
1 parent 170bc8f commit 43e2956
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/damavand/cloud/aws/resources/vllm_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def api(self) -> aws.apigateway.RestApi:

return aws.apigateway.RestApi(
resource_name=f"{self._name}-api",
opts=ResourceOptions(parent=self),
endpoint_configuration=aws.apigateway.RestApiEndpointConfigurationArgs(
types="REGIONAL",
),
Expand All @@ -244,6 +245,7 @@ def api(self) -> aws.apigateway.RestApi:
def api_resource(self) -> aws.apigateway.Resource:
return aws.apigateway.Resource(
resource_name=f"{self._name}-api-resource",
opts=ResourceOptions(parent=self),
rest_api=self.api.id,
parent_id=self.api.root_resource_id,
path_part="completions",
Expand All @@ -254,6 +256,7 @@ def api_resource(self) -> aws.apigateway.Resource:
def api_method(self) -> aws.apigateway.Method:
return aws.apigateway.Method(
resource_name=f"{self._name}-api-method",
opts=ResourceOptions(parent=self),
rest_api=self.api.id,
resource_id=self.api_resource.id,
http_method="POST",
Expand All @@ -275,6 +278,7 @@ def api_access_sagemaker_role(self) -> aws.iam.Role:

return aws.iam.Role(
resource_name=f"{self._name}-api-sagemaker-access-role",
opts=ResourceOptions(parent=self),
assume_role_policy=json.dumps(
self.get_service_assume_policy("apigateway.amazonaws.com")
),
Expand All @@ -289,6 +293,7 @@ def api_integration(self) -> aws.apigateway.Integration:

return aws.apigateway.Integration(
resource_name=f"{self._name}-api-integration",
opts=ResourceOptions(parent=self),
rest_api=self.api.id,
resource_id=self.api_resource.id,
http_method=self.api_method.http_method,
Expand Down

0 comments on commit 43e2956

Please sign in to comment.