def construct_pipeline_block(env='',
                             generated=None,
                             previous_env='',
                             region='us-east-1',
                             settings=None,
                             pipeline_data=None,
                             region_subnets=None,
                             **kwargs):
    """Create the Pipeline JSON from template.

    This handles the common repeatable patterns in a pipeline, such as
    judgement, infrastructure, tagger and qe.

    Note:
       ASG Health Check type is overridden to `EC2` when deploying to **dev** or
       using :ref:`eureka_enabled`.

    Args:
        env (str): Deploy environment name, e.g. dev, stage, prod.
        generated (gogoutils.Generator): Gogo Application name generator.
        kwargs (dict): Extra variables to pass to Pipeline Templates.
        previous_env (str): The previous deploy environment to use as
            Trigger.
        region (str): AWS Region to deploy to.
        settings (dict): Environment settings from configurations.
        pipeline_data (dict): Pipeline settings from configurations
        region_subnets (dict): Subnets for a Region, e.g.
            {'us-west-2': ['us-west-2a', 'us-west-2b', 'us-west-2c']}.

    Returns:
        dict: Pipeline JSON template rendered with configurations.

    """
    LOG.info('%s block for [%s].', env, region)
    LOG.debug('%s info:\n%s', env, pformat(settings))

    pipeline_type = pipeline_data['type']

    if pipeline_type in EC2_PIPELINE_TYPES:
        data = ec2_pipeline_setup(
            generated=generated,
            settings=settings,
            env=env,
            region=region,
            pipeline_type=pipeline_type,
            project=generated.project,
            region_subnets=region_subnets,
        )
    else:
        data = copy.deepcopy(settings)

    data['app'].update({
        'appname': generated.app_name(),
        'repo_name': generated.repo,
        'group_name': generated.project,
        'environment': env,
        'region': region,
        'previous_env': previous_env,
        'promote_restrict': pipeline_data['promote_restrict'],
        'owner_email': pipeline_data['owner_email'],
        'pipeline': pipeline_data,
    })

    LOG.debug('Block data:\n%s', pformat(data))

    template_name = get_template_name(env, pipeline_type)
    pipeline_json = get_template(template_file=template_name, data=data, formats=generated, **kwargs)
    return pipeline_json
Create the Pipeline JSON from template.

    This handles the common repeatable patterns in a pipeline, such as
    judgement, infrastructure, tagger and qe.

    Note:
       ASG Health Check type is overridden to `EC2` when deploying to **dev** or
       using :ref:`eureka_enabled`.

    Args:
        env (str): Deploy environment name, e.g. dev, stage, prod.
        generated (gogoutils.Generator): Gogo Application name generator.
        kwargs (dict): Extra variables to pass to Pipeline Templates.
        previous_env (str): The previous deploy environment to use as
            Trigger.
        region (str): AWS Region to deploy to.
        settings (dict): Environment settings from configurations.
        pipeline_data (dict): Pipeline settings from configurations
        region_subnets (dict): Subnets for a Region, e.g.
            {'us-west-2': ['us-west-2a', 'us-west-2b', 'us-west-2c']}.

    Returns:
        dict: Pipeline JSON template rendered with configurations.