Skip to content

Commit

Permalink
add more output metadata params
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Kukushkin <[email protected]>
  • Loading branch information
kukushking committed Feb 6, 2024
1 parent b9594b9 commit 50b19ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/sagemaker/sagemaker-endpoint/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def _param(name: str) -> str:
{
"ModelExecutionRoleArn": stack.model_execution_role_arn,
"ModelName": stack.model.model_name,
"EndpointName": stack.endpoint.endpoint_name,
"EndpointUrl": stack.endpoint.endpoint_name,
"ModelPackageArn": stack.model_package_arn,
"EndpointName": stack.endpoint.attr_endpoint_name,
"EndpointUrl": stack.endpoint_url,
}
),
)
Expand Down
4 changes: 4 additions & 0 deletions modules/sagemaker/sagemaker-endpoint/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def __init__(
model_package_arn = get_approved_package(self.region, model_package_group_name)
else:
raise ValueError("Either model_package_arn or model_package_group_name is required")
self.model_package_arn = model_package_arn

# Create model instance
model_name: str = f"{app_prefix}-model-{get_timestamp()}"
Expand Down Expand Up @@ -139,6 +140,9 @@ def __init__(
)
endpoint.add_dependency(endpoint_config)
self.endpoint = endpoint
self.endpoint_url = (
f"https://runtime.sagemaker.{self.region}.amazonaws.com/endpoints/{endpoint.attr_endpoint_name}/invocations"
)

# Add CDK nag solutions checks
Aspects.of(self).add(AwsSolutionsChecks())
Expand Down

0 comments on commit 50b19ab

Please sign in to comment.