Merge pull request #226 from Hestia-Homes/main

Allowing all s3 permissions for predictions bucket for sapmodel
This commit is contained in:
KhalimCK 2023-09-12 19:00:20 +01:00 committed by GitHub
commit bafba8f4c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -399,17 +399,11 @@ async def trigger_plan(body: PlanTriggerRequest):
)
# Retrieve the predictions
logger.info("Retrieving predictions from s3")
test = read_csv_from_s3(
bucket_name="retrofit-sap-predictions-{environment}".format(environment=get_settings().ENVIRONMENT),
filepath=response["storage_filepath"]
)
predictions = pd.DataFrame(read_csv_from_s3(
bucket_name="retrofit-sap-predictions-{environment}".format(environment=get_settings().ENVIRONMENT),
filepath=response["storage_filepath"]
))
# We round the predictions
predictions["RDSAP_CHANGE"] = predictions["RDSAP_CHANGE"].astype(float).round(0)
# Extract property_id and recommendation_id

View file

@ -30,9 +30,10 @@ provider:
# Allow reading and writing to PREDICTIONS_BUCKET
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObject
- s3:ListBucket
- s3:*
# - s3:GetObject
# - s3:PutObject
# - s3:ListBucket
Resource:
- arn:aws:s3:::${env:PREDICTIONS_BUCKET}
- arn:aws:s3:::${env:PREDICTIONS_BUCKET}/*