in broadcast-monitoring/infrastructure/elemental/custom_resources/custom-resource-py/libs/medialive.py [0:0]
def create_pull_input(config):
Name = config['StreamName']
Sources = [
{
'Url': config['PriUrl']
},
{
'Url': config['PriUrl']
}
]
Type = config['Type']
# store input u/p in SSM
if config['PriUser']:
Sources[0]['Username'] = config['PriUser']
# Sources[0]['Username'] = config['PriUser']
ssm.put_parameter(
Name=config['PriUser'],
Description='Live Stream solution Primary input credentials',
Type='string',
Value=config['PriPass']
)
# store input u/p in SSM
if config['SecUser']:
Sources[1]['Username'] = config['SecUser']
# Sources[1]['Username'] = config['SecUser']
ssm.put_parameter(
Name=config['PriUser'],
Description='Live Stream solution Primary input credentials',
Type='string',
Value=config['PriPass']
)
response = medialive.create_input(
Name=Name,
Type=Type,
Sources=Sources
)
responseData['Id'] = response['Input']['Id']
responseData['EndPoint1'] = 'Push InputType only'
responseData['EndPoint2'] = 'Push InputType only'
print('RESPONSE::{}'.format(responseData))
return responseData