in 04_EdgeApplication/turbine/util.py [0:0]
def get_client(service_name, iot_params):
'''
Build a boto3 client of a given service
It uses the temp credentials exchanged by the certificates
'''
access_key_id,secret_access_key,session_token = get_aws_credentials(
iot_params['sagemaker_edge_provider_aws_iot_cred_endpoint'],
iot_params['sagemaker_edge_core_device_uuid'],
iot_params['sagemaker_edge_provider_aws_cert_file'],
iot_params['sagemaker_edge_provider_aws_cert_pk_file'],
iot_params['sagemaker_edge_provider_aws_ca_cert_file']
)
return boto3.client(
service_name, iot_params['sagemaker_edge_core_region'],
aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_key,
aws_session_token=session_token
)