def deployment_group(self, function_logical_id):
        """
        :param function_logical_id: logical_id of the function this deployment group belongs to
        :return: CodeDeployDeploymentGroup resource
        """
        deployment_preference = self.get(function_logical_id)

        deployment_group = CodeDeployDeploymentGroup(self.deployment_group_logical_id(function_logical_id))

        if deployment_preference.alarms is not None:
            deployment_group.AlarmConfiguration = {'Enabled': True,
                                                   'Alarms': [{'Name': alarm} for alarm in
                                                              deployment_preference.alarms]}

        deployment_group.ApplicationName = self.codedeploy_application.get_runtime_attr('name')
        deployment_group.AutoRollbackConfiguration = {'Enabled': True,
                                                      'Events': ['DEPLOYMENT_FAILURE',
                                                                 'DEPLOYMENT_STOP_ON_ALARM',
                                                                 'DEPLOYMENT_STOP_ON_REQUEST']}
        deployment_group.DeploymentConfigName = fnSub("CodeDeployDefault.Lambda${ConfigName}",
                                                      {"ConfigName": deployment_preference.deployment_type})
        deployment_group.DeploymentStyle = {'DeploymentType': 'BLUE_GREEN',
                                            'DeploymentOption': 'WITH_TRAFFIC_CONTROL'}

        deployment_group.ServiceRoleArn = self.codedeploy_iam_role.get_runtime_attr("arn")
        if deployment_preference.role:
            deployment_group.ServiceRoleArn = deployment_preference.role

        return deployment_group
:param function_logical_id: logical_id of the function this deployment group belongs to
        :return: CodeDeployDeploymentGroup resource