Skip to content

Commit bc2aedd

Browse files
committed
Add session token to the AWS credentials
1 parent bcf674d commit bc2aedd

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

prometrix/connect/aws_connect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
class AWSPrometheusConnect(CustomPrometheusConnect):
1414
def __init__(
15-
self, access_key: str, secret_key: str, region: str, service_name: str, **kwargs
15+
self, access_key: str, secret_key: str, region: str, service_name: str, token: Optional[str] = None, **kwargs
1616
):
1717
super().__init__(**kwargs)
18-
self._credentials = Credentials(access_key, secret_key)
18+
self._credentials = Credentials(access_key, secret_key, token)
1919
self._sigv4auth = S3SigV4Auth(self._credentials, service_name, region)
2020

2121
def signed_request(

prometrix/models/prometheus_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class PrometheusConfig(BaseModel):
3232
class AWSPrometheusConfig(PrometheusConfig):
3333
access_key: str
3434
secret_access_key: str
35+
token: Optional[str] = None
3536
service_name: str = "aps"
3637
aws_region: str
3738
supported_apis: List[PrometheusApis] = [

prometrix/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def get_custom_prometheus_connect(
3737
service_name=prom_config.service_name,
3838
region=prom_config.aws_region,
3939
config=prom_config,
40+
token=prom_config.token,
4041
)
4142
else:
4243
prom = CustomPrometheusConnect(config=prom_config)

0 commit comments

Comments
 (0)