Skip to content

Commit

Permalink
Move some hooks into tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ferruzzi committed Apr 29, 2024
1 parent 5029167 commit 68f762a
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _create_access_policy(name, policy_type, policy):
"ResourceType": "index",
},
],
"Principal": [(sts_hook.conn.get_caller_identity()["Arn"]), bedrock_role_arn],
"Principal": [(StsHook().conn.get_caller_identity()["Arn"]), bedrock_role_arn],
}
],
)
Expand Down Expand Up @@ -253,7 +253,7 @@ def copy_data_to_s3(bucket: str):
for source in sources:
with tempfile.NamedTemporaryFile(mode="w", prefix="") as data_file:
urlretrieve(source, data_file.name)
s3_hook.conn.upload_file(
S3Hook().conn.upload_file(
Filename=data_file.name, Bucket=bucket, Key=os.path.basename(data_file.name)
)

Expand Down Expand Up @@ -385,9 +385,6 @@ def delete_opensearch_policies():

aoss_client = OpenSearchServerlessHook().conn
bedrock_agent_client = BedrockAgentHook().conn
iam_client = boto3.client("iam")
sts_hook = StsHook()
s3_hook = S3Hook()

region_name = boto3.session.Session().region_name

Expand Down

0 comments on commit 68f762a

Please sign in to comment.