Skip to content

Commit

Permalink
fix: make data access role optional in ingest runtime (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
slesaad authored May 28, 2024
1 parent f83f668 commit c55e375
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ingest_api/runtime/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Settings(BaseSettings):
description="URL of JWKS, e.g. https://cognito-idp.{region}.amazonaws.com/{userpool_id}/.well-known/jwks.json" # noqa
)

data_access_role_arn: AwsArn = Field( # type: ignore
data_access_role_arn: Optional[AwsArn] = Field( # type: ignore
description="ARN of AWS Role used to validate access to S3 data"
)

Expand Down
4 changes: 3 additions & 1 deletion ingest_api/runtime/src/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
def get_s3_credentials():
from src.main import settings

print("Fetching S3 Credentials...")
if not settings.data_access_role_arn:
return {}

print("Fetching S3 Credentials...")
response = boto3.client("sts").assume_role(
RoleArn=settings.data_access_role_arn,
RoleSessionName="stac-ingestor-data-validation",
Expand Down

0 comments on commit c55e375

Please sign in to comment.