diff --git a/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py b/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py index 3f68d828f..6f74f4229 100644 --- a/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py +++ b/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py @@ -595,7 +595,11 @@ def _grant_rel_data_secrets( for rel_id in all_rel_ids: if relation := self.get_rel(rel_id=rel_id): - self.secrets.grant_secret_to_relation(secret_id, relation) + if key == "s3": + self.secrets.grant_secret_to_relation(secret_id["access_key"], relation) + self.secrets.grant_secret_to_relation(secret_id["secret_key"], relation) + else: + self.secrets.grant_secret_to_relation(secret_id, relation) class OpenSearchPeerClusterRequirer(OpenSearchPeerClusterRelation):