INNER CODE UNIT · Python
get_pipeline
miztiik/AWS-Demos · how-to-examples/iam-s3-sqs-sns-video-transcoder.py:358
def get_pipeline(self):
"""
Get or create a pipeline. When creating, it is configured
with the previously set up S3 buckets, SNS topic, and IAM
role. Returns its ID.
"""
paginator = self.transcoder.get_paginator('list_pipelines')
for page in paginator.paginate():
for pipeline in page['Pipelines']:
if pipeline['Name'] == self.pipeline_name:
return pipeline['Id']
response = self.transcoder.create_pipeline(
Name=self.pipeline_name,
InputBucket=self.in_bucket_name,
OutputBucket=self.out_bucket_name,
Role=self.role.arn,
Notifications={