def lambda_handler(event, _):
    codepipeline = CodePipeline(boto3, os.environ['AWS_REGION'])

    pipeline_status = codepipeline.get_pipeline_status(
        'aws-deployment-framework-pipelines').get('status')

    if pipeline_status == 'Failed':
        LOGGER.info(
            'aws-deployment-framework-pipelines is in a failed state. Exiting.'
        )
        return event

    if not pipeline_status == 'InProgress':
        codepipeline.start_pipeline_execution(
            'aws-deployment-framework-pipelines')
        LOGGER.info('aws-deployment-framework-pipelines is already running')

    return event
Ejemplo n.º 2
0
def lambda_handler(event, _):
    """
    Responsible for triggering the aws-deployment-framework-pipelines
    pipeline if its not already running
    """
    codepipeline = CodePipeline(boto3, os.environ['AWS_REGION'])

    pipeline_status = codepipeline.get_pipeline_status(
        'aws-deployment-framework-pipelines')

    if pipeline_status in ('Failed', 'InProgress'):
        LOGGER.info('aws-deployment-framework-pipelines is in %s. Exiting.',
                    pipeline_status)
        return generate_notify_message(event)

    codepipeline.start_pipeline_execution('aws-deployment-framework-pipelines')

    return generate_notify_message(event)
Ejemplo n.º 3
0
def cls():
    return CodePipeline(boto3, os.environ["AWS_REGION"])